Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
69 changes: 52 additions & 17 deletions .github/workflows/validate-skip-qa.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,18 @@ name: 'Validate skip QA label'

on:
pull_request:
types: [opened, synchronize, reopened, labeled, unlabeled]
types: [opened, synchronize]
branches:
- master

env:
COMMENT_BODY_ADD_LABEL: |
⚠️ **Recommendation: Add `qa/skip-qa` Label**

This PR does not modify any files shipped with the agent.

To help streamline the release process, please consider adding the `qa/skip-qa` label if these changes do not require QA testing.

jobs:
validate-skip-qa:
runs-on: ubuntu-latest
Expand All @@ -31,8 +39,16 @@ jobs:
datadog_checks_dev/**
datadog_checks_tests_helper/**

- name: Post message - Add skip qa label
- name: Find comment - Add skip qa label
if: steps.changed_files.outputs.any_changed == 'false' && !contains(github.event.pull_request.labels.*.name, 'qa/skip-qa')
uses: peter-evans/find-comment@3eae4d37986fb5a8592848f6a574fdf654e61f9e # v3.1.0
id: find_comment_add_label
with:
issue-number: ${{ github.event.pull_request.number }}
body-includes: ${{ env.COMMENT_BODY_ADD_LABEL }}

- name: Post message - Add skip qa label
if: steps.changed_files.outputs.any_changed == 'false' && !contains(github.event.pull_request.labels.*.name, 'qa/skip-qa') && steps.find_comment_add_label.outputs.comment-id == ''
uses: peter-evans/create-or-update-comment@71345be0265236311c031f5c7866368bd1eff043 # v4.0.0
with:
issue-number: ${{ github.event.pull_request.number }}
Expand All @@ -52,24 +68,43 @@ jobs:
echo "$formatted_list" >> $GITHUB_OUTPUT
echo "EOF" >> $GITHUB_OUTPUT

- name: Post comment - Remove skip qa label
- name: Construct "Remove skip qa label" comment body
id: construct_remove_label_comment
if: steps.changed_files.outputs.any_changed == 'true' && contains(github.event.pull_request.labels.*.name, 'qa/skip-qa')
uses: peter-evans/create-or-update-comment@71345be0265236311c031f5c7866368bd1eff043 # v4.0.0
with:
issue-number: ${{ github.event.pull_request.number }}
body: |
⚠️ **The `qa/skip-qa` label has been added with shippable changes**
run: |
comment_body=$(cat <<EOF
⚠️ **The \`qa/skip-qa\` label has been added with shippable changes**

The following files, which will be shipped with the agent, were modified in this PR and
the \`qa/skip-qa\` label has been added.

The following files, which will be shipped with the agent, were modified in this PR and
the `qa/skip-qa` label has been added.
You can ignore this if you are sure the changes in this PR do not require QA. Otherwise, consider removing the label.

You can ignore this if you are sure the changes in this PR do not require QA. Otherwise, consider removing the label.
<details>
<summary>List of modified files that will be shipped with the agent</summary>

<details>
<summary>List of modified files that will be shipped with the agent</summary>
\`\`\`
${{ steps.format_files.outputs.file_list }}
\`\`\`

```
${{ steps.format_files.outputs.file_list }}
```
</details>
EOF
)
echo "body<<EOF" >> $GITHUB_OUTPUT
echo "$comment_body" >> $GITHUB_OUTPUT
echo "EOF" >> $GITHUB_OUTPUT

</details>
- name: Find comment - Remove skip qa label
if: steps.changed_files.outputs.any_changed == 'true' && contains(github.event.pull_request.labels.*.name, 'qa/skip-qa')
uses: peter-evans/find-comment@3eae4d37986fb5a8592848f6a574fdf654e61f9e # v3.1.0
id: find_comment_remove_label
with:
issue-number: ${{ github.event.pull_request.number }}
body-includes: ${{ steps.construct_remove_label_comment.outputs.body }}

- name: Post comment - Remove skip qa label
if: steps.changed_files.outputs.any_changed == 'true' && contains(github.event.pull_request.labels.*.name, 'qa/skip-qa') && steps.find_comment_remove_label.outputs.comment-id == ''
uses: peter-evans/create-or-update-comment@71345be0265236311c031f5c7866368bd1eff043 # v4.0.0
with:
issue-number: ${{ github.event.pull_request.number }}
body: ${{ steps.construct_remove_label_comment.outputs.body }}
1 change: 1 addition & 0 deletions ddev/changelog.d/21021.fixed
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Add is:pull-request to pull request search to avoid 422s on private repos
2 changes: 1 addition & 1 deletion ddev/src/ddev/utils/github.py
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ def get_pull_request(self, sha: str) -> PullRequest | None:
response = self.__api_get(
self.ISSUE_SEARCH_API,
# https://docs.github.com/en/search-github/searching-on-github/searching-issues-and-pull-requests
params={'q': f'sha:{sha} repo:{self.repo_id}'},
params={'q': f'sha:{sha} repo:{self.repo_id} is:pull-request'},
)
data = loads(response.text)
if not data['items']:
Expand Down
2 changes: 1 addition & 1 deletion ddev/tests/fixtures/network/github/get_pr_found.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ interactions:
x-github-api-version:
- '2022-11-28'
method: GET
uri: https://api.github.com/search/issues?q=sha%3A382cbb0af210897599cbe5fd8d69a38d4017e425%20repo%3ADataDog/integrations-core
uri: https://api.github.com/search/issues?q=sha%3A382cbb0af210897599cbe5fd8d69a38d4017e425%20repo%3ADataDog/integrations-core%20is%3Apull-request
response:
content: '{"total_count":1,"incomplete_results":false,"items":[{"url":"https://api.github.com/repos/DataDog/integrations-core/issues/14849","repository_url":"https://api.github.com/repos/DataDog/integrations-core","labels_url":"https://api.github.com/repos/DataDog/integrations-core/issues/14849/labels{/name}","comments_url":"https://api.github.com/repos/DataDog/integrations-core/issues/14849/comments","events_url":"https://api.github.com/repos/DataDog/integrations-core/issues/14849/events","html_url":"https://github.com/DataDog/integrations-core/pull/14849","id":1770340827,"node_id":"PR_kwDOAtBC5c5TsQjl","number":14849,"title":"Update
formatting for changelogs","user":{"login":"swang392","id":24441980,"node_id":"MDQ6VXNlcjI0NDQxOTgw","avatar_url":"https://avatars.githubusercontent.com/u/24441980?v=4","gravatar_id":"","url":"https://api.github.com/users/swang392","html_url":"https://github.com/swang392","followers_url":"https://api.github.com/users/swang392/followers","following_url":"https://api.github.com/users/swang392/following{/other_user}","gists_url":"https://api.github.com/users/swang392/gists{/gist_id}","starred_url":"https://api.github.com/users/swang392/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/swang392/subscriptions","organizations_url":"https://api.github.com/users/swang392/orgs","repos_url":"https://api.github.com/users/swang392/repos","events_url":"https://api.github.com/users/swang392/events{/privacy}","received_events_url":"https://api.github.com/users/swang392/received_events","type":"User","site_admin":false},"labels":[{"id":581315931,"node_id":"MDU6TGFiZWw1ODEzMTU5MzE=","url":"https://api.github.com/repos/DataDog/integrations-core/labels/documentation","name":"documentation","color":"7e1df4","default":true,"description":""},{"id":932725515,"node_id":"MDU6TGFiZWw5MzI3MjU1MTU=","url":"https://api.github.com/repos/DataDog/integrations-core/labels/changelog/no-changelog","name":"changelog/no-changelog","color":"eeeeee","default":false,"description":""},{"id":936563014,"node_id":"MDU6TGFiZWw5MzY1NjMwMTQ=","url":"https://api.github.com/repos/DataDog/integrations-core/labels/integration/apache","name":"integration/apache","color":"bfdadc","default":false,"description":""}],"state":"closed","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":0,"created_at":"2023-06-22T20:21:09Z","updated_at":"2023-06-23T16:56:28Z","closed_at":"2023-06-23T16:56:27Z","author_association":"MEMBER","active_lock_reason":null,"draft":false,"pull_request":{"url":"https://api.github.com/repos/DataDog/integrations-core/pulls/14849","html_url":"https://github.com/DataDog/integrations-core/pull/14849","diff_url":"https://github.com/DataDog/integrations-core/pull/14849.diff","patch_url":"https://github.com/DataDog/integrations-core/pull/14849.patch","merged_at":"2023-06-23T16:56:27Z"},"body":"###
Expand Down
2 changes: 1 addition & 1 deletion ddev/tests/fixtures/network/github/get_pr_no_match.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ interactions:
x-github-api-version:
- '2022-11-28'
method: GET
uri: https://api.github.com/search/issues?q=sha%3Afcd9c178cb01bcb349c694d34fe6ae237e3c1aa8%20repo%3ADataDog/integrations-core
uri: https://api.github.com/search/issues?q=sha%3Afcd9c178cb01bcb349c694d34fe6ae237e3c1aa8%20repo%3ADataDog/integrations-core%20is%3Apull-request
response:
content: '{"total_count":0,"incomplete_results":false,"items":[]}'
headers:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ interactions:
x-github-api-version:
- '2022-11-28'
method: GET
uri: https://api.github.com/search/issues?q=sha%3Acfd8020b628cc24eebadae2ab79a3a1be285885c%20repo%3ADataDog/integrations-core
uri: https://api.github.com/search/issues?q=sha%3Acfd8020b628cc24eebadae2ab79a3a1be285885c%20repo%3ADataDog/integrations-core%20is%3Apull-request
response:
content: '{"total_count":1,"incomplete_results":false,"items":[{"url":"https://api.github.com/repos/DataDog/integrations-core/issues/15459","repository_url":"https://api.github.com/repos/DataDog/integrations-core","labels_url":"https://api.github.com/repos/DataDog/integrations-core/issues/15459/labels{/name}","comments_url":"https://api.github.com/repos/DataDog/integrations-core/issues/15459/comments","events_url":"https://api.github.com/repos/DataDog/integrations-core/issues/15459/events","html_url":"https://github.com/DataDog/integrations-core/pull/15459","id":1833090960,"node_id":"PR_kwDOAtBC5c5XAVK1","number":15459,"title":"Add
changelog enforcement","user":{"login":"ofek","id":9677399,"node_id":"MDQ6VXNlcjk2NzczOTk=","avatar_url":"https://avatars.githubusercontent.com/u/9677399?v=4","gravatar_id":"","url":"https://api.github.com/users/ofek","html_url":"https://github.com/ofek","followers_url":"https://api.github.com/users/ofek/followers","following_url":"https://api.github.com/users/ofek/following{/other_user}","gists_url":"https://api.github.com/users/ofek/gists{/gist_id}","starred_url":"https://api.github.com/users/ofek/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ofek/subscriptions","organizations_url":"https://api.github.com/users/ofek/orgs","repos_url":"https://api.github.com/users/ofek/repos","events_url":"https://api.github.com/users/ofek/events{/privacy}","received_events_url":"https://api.github.com/users/ofek/received_events","type":"User","site_admin":false},"labels":[{"id":581315931,"node_id":"MDU6TGFiZWw1ODEzMTU5MzE=","url":"https://api.github.com/repos/DataDog/integrations-core/labels/documentation","name":"documentation","color":"7e1df4","default":true,"description":""},{"id":936341014,"node_id":"MDU6TGFiZWw5MzYzNDEwMTQ=","url":"https://api.github.com/repos/DataDog/integrations-core/labels/dev/testing","name":"dev/testing","color":"6ad86c","default":false,"description":""},{"id":936375010,"node_id":"MDU6TGFiZWw5MzYzNzUwMTA=","url":"https://api.github.com/repos/DataDog/integrations-core/labels/dev/tooling","name":"dev/tooling","color":"6ad86c","default":false,"description":""},{"id":4541502693,"node_id":"LA_kwDOAtBC5c8AAAABDrHU5Q","url":"https://api.github.com/repos/DataDog/integrations-core/labels/ddev","name":"ddev","color":"ededed","default":false,"description":null}],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":1,"created_at":"2023-08-02T12:28:48Z","updated_at":"2023-08-03T07:34:19Z","closed_at":null,"author_association":"MEMBER","active_lock_reason":null,"draft":false,"pull_request":{"url":"https://api.github.com/repos/DataDog/integrations-core/pulls/15459","html_url":"https://github.com/DataDog/integrations-core/pull/15459","diff_url":"https://github.com/DataDog/integrations-core/pull/15459.diff","patch_url":"https://github.com/DataDog/integrations-core/pull/15459.patch","merged_at":null},"body":"###
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ interactions:
x-github-api-version:
- '2022-11-28'
method: GET
uri: https://api.github.com/search/issues?q=sha%3A0000000000000000000000000000000000000000%20repo%3ADataDog/integrations-core
uri: https://api.github.com/search/issues?q=sha%3A0000000000000000000000000000000000000000%20repo%3ADataDog/integrations-core%20is%3Apull-request
response:
content: '{"total_count":0,"incomplete_results":false,"items":[]}'
headers:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ interactions:
x-github-api-version:
- '2022-11-28'
method: GET
uri: https://api.github.com/search/issues?q=sha%3Aed4909414c5aedeba347b523b3c40ecd651896ab%20repo%3ADataDog%2Fintegrations-core
uri: https://api.github.com/search/issues?q=sha%3Aed4909414c5aedeba347b523b3c40ecd651896ab%20repo%3ADataDog%2Fintegrations-core%20is%3Apull-request
response:
content: '{"total_count":1,"incomplete_results":false,"items":[{"url":"https://api.github.com/repos/DataDog/integrations-core/issues/15520","repository_url":"https://api.github.com/repos/DataDog/integrations-core","labels_url":"https://api.github.com/repos/DataDog/integrations-core/issues/15520/labels{/name}","comments_url":"https://api.github.com/repos/DataDog/integrations-core/issues/15520/comments","events_url":"https://api.github.com/repos/DataDog/integrations-core/issues/15520/events","html_url":"https://github.com/DataDog/integrations-core/pull/15520","id":1843390772,"node_id":"PR_kwDOAtBC5c5Xi0tE","number":15520,"title":"Register
custom marker","user":{"login":"iliakur","id":899591,"node_id":"MDQ6VXNlcjg5OTU5MQ==","avatar_url":"https://avatars.githubusercontent.com/u/899591?v=4","gravatar_id":"","url":"https://api.github.com/users/iliakur","html_url":"https://github.com/iliakur","followers_url":"https://api.github.com/users/iliakur/followers","following_url":"https://api.github.com/users/iliakur/following{/other_user}","gists_url":"https://api.github.com/users/iliakur/gists{/gist_id}","starred_url":"https://api.github.com/users/iliakur/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/iliakur/subscriptions","organizations_url":"https://api.github.com/users/iliakur/orgs","repos_url":"https://api.github.com/users/iliakur/repos","events_url":"https://api.github.com/users/iliakur/events{/privacy}","received_events_url":"https://api.github.com/users/iliakur/received_events","type":"User","site_admin":false},"labels":[{"id":932725515,"node_id":"MDU6TGFiZWw5MzI3MjU1MTU=","url":"https://api.github.com/repos/DataDog/integrations-core/labels/changelog/no-changelog","name":"changelog/no-changelog","color":"eeeeee","default":false,"description":""},{"id":4541502693,"node_id":"LA_kwDOAtBC5c8AAAABDrHU5Q","url":"https://api.github.com/repos/DataDog/integrations-core/labels/ddev","name":"ddev","color":"ededed","default":false,"description":null}],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":2,"created_at":"2023-08-09T14:31:14Z","updated_at":"2023-08-09T22:39:43Z","closed_at":null,"author_association":"MEMBER","active_lock_reason":null,"draft":false,"pull_request":{"url":"https://api.github.com/repos/DataDog/integrations-core/pulls/15520","html_url":"https://github.com/DataDog/integrations-core/pull/15520","diff_url":"https://github.com/DataDog/integrations-core/pull/15520.diff","patch_url":"https://github.com/DataDog/integrations-core/pull/15520.patch","merged_at":null},"body":"###
Expand Down
Loading