Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Multiple CodeCommit repos using the same SQS queue #2

Open
ronaldtse opened this issue Oct 11, 2016 · 1 comment
Open

Multiple CodeCommit repos using the same SQS queue #2

ronaldtse opened this issue Oct 11, 2016 · 1 comment

Comments

@ronaldtse
Copy link

Hi Nick,

Thank you for the great work with the aws-sqs plugin!

We are trying to use multiple CodeCommit repos with a single SQS queue. Currently, when the plugin receives any sort of notification from CodeCommit, it triggers the build of ALL jobs that matches the branch (of the SNS message), but without consideration of the repo that generated it (eventSourceARN).

For example, if I have two repos ("FOO" and "BAR") and a job for each that tracks the "master" branch, a notification of "FOO/master" being updated will trigger both jobs, which is obviously not correct.

Is it possible to extend this plugin to use the eventSourceARN to filter out which repo to trigger? Without this we will have to create N SQS queues for N repos, which can be a lot, and also makes the Jenkins configuration of them very cumbersome.

For your reference here is a sample SNS message that shows where eventSourceARN is located.

{
  "Records": [
    {
      "awsRegion": "us-east-1",
      "codecommit": {
        "references": [
          {
            "commit": "eedd7213b474f914db1c25c3313d9e7be6ba71d0",
            "ref": "refs/heads/feature/my_new_feature"
          },
          {
            "commit": "eedd7213b474f914db1c25c3313d9e7be6ba71d0",
            "ref": "refs/tags/v110"
          }
        ]
      },
      "customData": "",
      "eventId": "464817b2-e391-4cf9-bf52-bd0ed1ad6900",
      "eventName": "TriggerEventTest",
      "eventPartNumber": 1,
      "eventSource": "aws:codecommit",
      "eventSourceARN": "arn:aws:codecommit:us-east-1:{aws-account-id}:{codecommit-repo-name}",
      "eventTime": "2016-10-11T13:52:59.745+0000",
      "eventTotalParts": 1,
      "eventTriggerConfigId": "464817b2-e391-4cf9-bf52-bd0ed1ad6900",
      "eventTriggerName": "notifications",
      "eventVersion": "1.0",
      "userIdentityARN": "{aws-user-arn}"
    }
  ]
}

Thank you for your help!

@phuonghuynh
Copy link

phuonghuynh commented Jun 23, 2017

@ronaldtse @nickgrealy likewise issue riboseinc#2

PR for it submitted to our fork and is testing riboseinc#1

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants