Slackbot
12/15/2022, 11:43 AMOr Weis
12/15/2022, 11:53 AMSumesh Sukumaran
12/15/2022, 12:13 PMOr Weis
12/15/2022, 1:27 PMOr Weis
12/15/2022, 3:55 PMOPAL_POLICY_REPO_WEBHOOK_PARAMS= {
"secret_header_name": "X-Gitlab-Token",
"secret_type": "token",
"secret_parsing_regex": "(.*)",
"event_header_name": "X-Gitlab-Event",
"push_event_value": "Push Hook",
}
This is the config for Gitlab - it would be great if you can share the config you end up using for Azure (or let us know if something is missing)Sumesh Sukumaran
12/15/2022, 4:33 PMOr Weis
12/15/2022, 4:37 PMSumesh Sukumaran
12/15/2022, 5:31 PMOr Weis
12/15/2022, 5:46 PMSumesh Sukumaran
12/15/2022, 6:10 PMOr Weis
12/15/2022, 6:11 PMPentry Yurhadi
12/21/2022, 4:17 AMstages:
- deploy
deploy:
stage: deploy
before_script:
- apk add --update curl && rm -rf /var/cache/apk/*
script:
- |
curl --location --request POST '<opal-server-url>/webhook' \
--header 'x-hub-signature-256: sha256=9d08c9c0b4c2862b282ae23c43cdd3b14a1965fdcf55feb2207ae21cd21e0a93' \
--header 'X-GitHub-Event: push' \
--header 'Content-Type: application/json' \
--data-raw '{
"action" : "push",
"repository": {
"ssh_url" : "<gitlab-ssh-url>"
}
}'
maybe you can also try it in azureOr Weis
12/21/2022, 7:09 AMOr Weis
12/21/2022, 7:12 AMPentry Yurhadi
12/21/2022, 7:27 AMOr Weis
01/02/2023, 12:19 AMSumesh Sukumaran
01/05/2023, 9:51 AMSumesh Sukumaran
01/06/2023, 6:28 AMOr Weis
01/06/2023, 6:36 AMSumesh Sukumaran
01/31/2023, 9:59 AMOr Weis
01/31/2023, 10:02 AMOr Weis
01/31/2023, 10:03 AMSumesh Sukumaran
01/31/2023, 10:05 AMOr Weis
01/31/2023, 10:10 AMAsaf Cohen
01/31/2023, 10:11 AMSumesh Sukumaran
01/31/2023, 11:20 AMSumesh Sukumaran
02/06/2023, 3:08 PMOded Bd
02/06/2023, 3:29 PMx-api-key=YOUR_WEBHOOK_SECRET
to your HTTP headers
As you can see in this docs https://docs.opal.ac/tutorials/track_a_git_repo#option-2-using-a-webhook
under Azure-Git sectionSumesh Sukumaran
02/06/2023, 3:36 PMSumesh Sukumaran
02/07/2023, 4:31 AMOr Weis
02/07/2023, 8:06 AMSumesh Sukumaran
02/07/2023, 9:11 AMMethod: POST
URI: https://1730-122-50-209-214.in.ngrok.io/webhook
HTTP Version: 1.1
Headers:
{
x-api-key: ********
Content-Type: application/json; charset=utf-8
}
Content:
{
"subscriptionId": "440a9037-46f6-43fb-9d8c-33dcfe3886b5",
"notificationId": 13,
"id": "2c0a54da-9ba2-4293-aa7c-d349f09b91d4",
"eventType": "git.push",
"publisherId": "tfs",
"message": {
"text": "Sumesh S pushed updates to OPAL-Policy-Repo:master\r\n(https://dev.azure.com/Alegeus-Technologies/ArchitectureCouncil/_git/OPAL-Policy-Repo/#version=GBmaster)",
"html": "Sumesh S pushed updates to <a href=\"https://dev.azure.com/Alegeus-Technologies/ArchitectureCouncil/_git/OPAL-Policy-Repo/\">OPAL-Policy-Repo</a>:<a href=\"https://dev.azure.com/Alegeus-Technologies/ArchitectureCouncil/_git/OPAL-Policy-Repo/#version=GBmaster\">master</a>",
"markdown": "Sumesh S pushed updates to [OPAL-Policy-Repo](https://dev.azure.com/Alegeus-Technologies/ArchitectureCouncil/_git/OPAL-Policy-Repo/):[master](https://dev.azure.com/Alegeus-Technologies/ArchitectureCouncil/_git/OPAL-Policy-Repo/#version=GBmaster)"
},
"detailedMessage": {
"text": "Sumesh S pushed a commit to OPAL-Policy-Repo:master\r\n - adsa 982ef9ee (https://dev.azure.com/Alegeus-Technologies/ArchitectureCouncil/_git/OPAL-Policy-Repo/commit/982ef9ee66b3349cd0e09b3b3a326bec8047aab8)",
"html": "Sumesh S pushed a commit to <a href=\"https://dev.azure.com/Alegeus-Technologies/ArchitectureCouncil/_git/OPAL-Policy-Repo/\">OPAL-Policy-Repo</a>:<a href=\"https://dev.azure.com/Alegeus-Technologies/ArchitectureCouncil/_git/OPAL-Policy-Repo/#version=GBmaster\">master</a>\r\n<ul>\r\n<li>adsa <a href=\"https://dev.azure.com/Alegeus-Technologies/ArchitectureCouncil/_git/OPAL-Policy-Repo/commit/982ef9ee66b3349cd0e09b3b3a326bec8047aab8\">982ef9ee</a></li>\r\n</ul>",
"markdown": "Sumesh S pushed a commit to [OPAL-Policy-Repo](https://dev.azure.com/Alegeus-Technologies/ArchitectureCouncil/_git/OPAL-Policy-Repo/):[master](https://dev.azure.com/Alegeus-Technologies/ArchitectureCouncil/_git/OPAL-Policy-Repo/#version=GBmaster)\r\n* adsa [982ef9ee](https://dev.azure.com/Alegeus-Technologies/ArchitectureCouncil/_git/OPAL-Policy-Repo/commit/982ef9ee66b3349cd0e09b3b3a326bec8047aab8)"
},
"resource": {
"commits": [
{
"commitId": "982ef9ee66b3349cd0e09b3b3a326bec8047aab8",
"author": {
"name": "sumesh.s@alegeus.com",
"email": "sumesh.s@alegeus.com",
"date": "2023-02-07T041314Z"
},
"committer": {
"name": "sumesh.s@alegeus.com",
"email": "sumesh.s@alegeus.com",
"date": "2023-02-07T041314Z"
},
"comment": "adsa",
"url": "https://dev.azure.com/Alegeus-Technologies/_apis/git/repositories/7286c5d3-b7c1-4ca8-8928-c82930a30bb1/commits/982ef9ee66b3349cd0e09b3b3a326bec8047aab8"
}
],
"refUpdates": [
{
"name": "refs/heads/master",
"oldObjectId": "fa5a8e4fe82837576df8da012987a3104270a851",
"newObjectId": "982ef9ee66b3349cd0e09b3b3a326bec8047aab8"
}
],
"repository": {
"id": "7286c5d3-b7c1-4ca8-8928-c82930a30bb1",
"name": "OPAL-Policy-Repo",
"url": "https://dev.azure.com/Alegeus-Technologies/_apis/git/repositories/7286c5d3-b7c1-4ca8-8928-c82930a30bb1",
"project": {
"id": "d7388abd-50f6-4da7-8b36-409edceba8a9",
"name": "ArchitectureCouncil",
"url": "https://dev.azure.com/Alegeus-Technologies/_apis/projects/d7388abd-50f6-4da7-8b36-409edceba8a9",
"state": "wellFormed",
"visibility": "unchanged",
"lastUpdateTime": "0001-01-01T000000"
},
"defaultBranch": "refs/heads/master",
"remoteUrl": "https://dev.azure.com/Alegeus-Technologies/ArchitectureCouncil/_git/OPAL-Policy-Repo"
},
"pushedBy": {
"displayName": "Sumesh S",
"url": "https://spsprodcus1.vssps.visualstudio.com/Adbba024b-4985-41b1-86e1-fb7a27d5055f/_apis/Identities/bfd07cea-8c9e-60dc-801c-efb0f661f638",
"_links": {
"avatar": {
"href": "https://dev.azure.com/Alegeus-Technologies/_apis/GraphProfile/MemberAvatars/aad.YmZkMDdjZWEtOGM5ZS03MGRjLTgwMWMtZWZiMGY2NjFmNjM4"
}
},
"id": "bfd07cea-8c9e-60dc-801c-efb0f661f638",
"uniqueName": "sumesh.s@alegeus.com",
"imageUrl": "https://dev.azure.com/Alegeus-Technologies/_api/_common/identityImage?id=bfd07cea-8c9e-60dc-801c-efb0f661f638",
"descriptor": "aad.YmZkMDdjZWEtOGM5ZS03MGRjLTgwMWMtZWZiMGY2NjFmNjM4"
},
"pushId": 396757,
"date": "2023-02-07T041319.6262277Z",
"url": "https://dev.azure.com/Alegeus-Technologies/_apis/git/repositories/7286c5d3-b7c1-4ca8-8928-c82930a30bb1/pushes/396757",
"_links": {
"self": {
"href": "https://dev.azure.com/Alegeus-Technologies/_apis/git/repositories/7286c5d3-b7c1-4ca8-8928-c82930a30bb1/pushes/396757"
},
"repository": {
"href": "https://dev.azure.com/Alegeus-Technologies/d7388abd-50f6-4da7-8b36-409edceba8a9/_apis/git/repositories/7286c5d3-b7c1-4ca8-8928-c82930a30bb1"
},
"commits": {
"href": "https://dev.azure.com/Alegeus-Technologies/_apis/git/repositories/7286c5d3-b7c1-4ca8-8928-c82930a30bb1/pushes/396757/commits"
},
"pusher": {
"href": "https://spsprodcus1.vssps.visualstudio.com/Adbba024b-4985-41b1-86e1-fb7a27d5055f/_apis/Identities/bfd07cea-8c9e-60dc-801c-efb0f661f638"
},
"refs": {
"href": "https://dev.azure.com/Alegeus-Technologies/d7388abd-50f6-4da7-8b36-409edceba8a9/_apis/git/repositories/7286c5d3-b7c1-4ca8-8928-c82930a30bb1/refs/heads/master"
}
}
},
"resourceVersion": "1.0",
"resourceContainers": {
"collection": {
"id": "02e6d2e0-ac7c-4ce9-b5a6-3bfaea7cddfa",
"baseUrl": "https://dev.azure.com/Alegeus-Technologies/"
},
"account": {
"id": "dbba024b-4985-41b1-86e1-fb7a27d5055f",
"baseUrl": "https://dev.azure.com/Alegeus-Technologies/"
},
"project": {
"id": "d7388abd-50f6-4da7-8b36-409edceba8a9",
"baseUrl": "https://dev.azure.com/Alegeus-Technologies/"
}
},
"createdDate": "2023-02-07T041326.9652352Z"
}
Or Weis
02/07/2023, 9:52 AMOPAL_POLICY_REPO_WEBHOOK_PARAMS
from you config screenshot
It should be, something like this (as per the docs):
{
"secret_header_name": "x-api-key",
"secret_type": "token",
"secret_parsing_regex": "(.*)",
"event_header_name": None,
"event_request_key": "eventType",
"push_event_value": "git.push",
}
Sumesh Sukumaran
02/07/2023, 11:00 AMOr Weis
02/07/2023, 11:05 AMOPAL_POLICY_REPO_WEBHOOK_PARAMS
Or Weis
02/07/2023, 11:05 AMSumesh Sukumaran
02/07/2023, 1:09 PMOr Weis
02/07/2023, 1:25 PMOr Weis
02/07/2023, 1:27 PMSumesh Sukumaran
02/07/2023, 3:38 PM<mailto:git@ssh.dev.azure.com|git@ssh.dev.azure.com>:v3/Alegeus-Technologies/ArchitectureCouncil/OPAL-Policy-Repo
<https://dev.azure.com/Alegeus-Technologies/ArchitectureCouncil/_git/OPAL-Policy-Repo>
Or Weis
02/07/2023, 3:59 PMOri Shavit
02/07/2023, 4:06 PMOr Weis
02/07/2023, 4:06 PMSumesh Sukumaran
02/18/2023, 3:00 PMOr Weis
02/18/2023, 3:04 PM/webhook
) meets the configuration you set in the webhook config params it would work.Sumesh Sukumaran
02/18/2023, 3:06 PM