From 37254457329eae397427691c4070ec84bcb340b6 Mon Sep 17 00:00:00 2001 From: McKnight-42 Date: Mon, 17 Jun 2024 10:32:13 -0500 Subject: [PATCH 1/7] update user docs-issue workflow --- .github/workflows/docs-issues.yml | 27 +++++++++++++-------------- 1 file changed, 13 insertions(+), 14 deletions(-) diff --git a/.github/workflows/docs-issues.yml b/.github/workflows/docs-issues.yml index 00a098df8..1c9fe46fe 100644 --- a/.github/workflows/docs-issues.yml +++ b/.github/workflows/docs-issues.yml @@ -1,19 +1,18 @@ # **what?** -# Open an issue in docs.getdbt.com when a PR is labeled `user docs` +# Open an issue in docs.getdbt.com when an issue is labeled `user docs` and closed as completed # **why?** # To reduce barriers for keeping docs up to date # **when?** -# When a PR is labeled `user docs` and is merged. Runs on pull_request_target to run off the workflow already merged, -# not the workflow that existed on the PR branch. This allows old PRs to get comments. +# When an issue is labeled `user docs` and is closed as completed. Can be labeled before or after the issue is closed. -name: Open issues in docs.getdbt.com repo when a PR is labeled -run-name: "Open an issue in docs.getdbt.com for PR #${{ github.event.pull_request.number }}" +name: Open issues in docs.getdbt.com repo when an issue is labeled +run-name: "Open an issue in docs.getdbt.com for issue #${{ github.event.issue.number }}" on: - pull_request_target: + issues: types: [labeled, closed] defaults: @@ -21,23 +20,23 @@ defaults: shell: bash permissions: - issues: write # opens new issues - pull-requests: write # comments on PRs - + issues: write # comments on issues jobs: open_issues: - # we only want to run this when the PR has been merged or the label in the labeled event is `user docs`. Otherwise it runs the + # we only want to run this when the issue is closed as completed and the label `user docs` has been assigned. + # If this logic does not exist in this workflow, it runs the # risk of duplicaton of issues being created due to merge and label both triggering this workflow to run and neither having # generating the comment before the other runs. This lives here instead of the shared workflow because this is where we # decide if it should run or not. if: | - (github.event.pull_request.merged == true) && - ((github.event.action == 'closed' && contains( github.event.pull_request.labels.*.name, 'user docs')) || - (github.event.action == 'labeled' && github.event.label.name == 'user docs')) + (github.event.issue.state == 'closed' && + github.event.issue.state_reason == 'completed' && + contains( github.event.issue.labels.*.name, 'user docs')) uses: dbt-labs/actions/.github/workflows/open-issue-in-repo.yml@main with: issue_repository: "dbt-labs/docs.getdbt.com" - issue_title: "Docs Changes Needed from ${{ github.event.repository.name }} PR #${{ github.event.pull_request.number }}" + issue_title: "Docs Changes Needed from ${{ github.event.repository.name }} Issue #${{ github.event.issue.number }}" issue_body: "At a minimum, update body to include a link to the page on docs.getdbt.com requiring updates and what part(s) of the page you would like to see updated." secrets: inherit + \ No newline at end of file From cc65c00eb2c3d48d525486177b1088ff4765a430 Mon Sep 17 00:00:00 2001 From: McKnight-42 Date: Mon, 17 Jun 2024 11:13:25 -0500 Subject: [PATCH 2/7] pre-commit fix --- .github/workflows/docs-issues.yml | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/.github/workflows/docs-issues.yml b/.github/workflows/docs-issues.yml index 1c9fe46fe..80d0e6dc7 100644 --- a/.github/workflows/docs-issues.yml +++ b/.github/workflows/docs-issues.yml @@ -38,5 +38,4 @@ jobs: issue_repository: "dbt-labs/docs.getdbt.com" issue_title: "Docs Changes Needed from ${{ github.event.repository.name }} Issue #${{ github.event.issue.number }}" issue_body: "At a minimum, update body to include a link to the page on docs.getdbt.com requiring updates and what part(s) of the page you would like to see updated." - secrets: inherit - \ No newline at end of file + secrets: inherit \ No newline at end of file From a5da3bdf3538a67a3851cdbb29b01ed3352513a4 Mon Sep 17 00:00:00 2001 From: McKnight-42 Date: Tue, 18 Jun 2024 13:35:26 -0500 Subject: [PATCH 3/7] update workflow based onf feedback --- .github/workflows/docs-issues.yml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/docs-issues.yml b/.github/workflows/docs-issues.yml index 80d0e6dc7..be1dc0951 100644 --- a/.github/workflows/docs-issues.yml +++ b/.github/workflows/docs-issues.yml @@ -30,12 +30,12 @@ jobs: # generating the comment before the other runs. This lives here instead of the shared workflow because this is where we # decide if it should run or not. if: | - (github.event.issue.state == 'closed' && - github.event.issue.state_reason == 'completed' && - contains( github.event.issue.labels.*.name, 'user docs')) + (github.event.issue.state == 'closed' && github.event.issue.state_reason == 'completed') && ( + (github.event.action == 'closed' && contains(github.event.issue.labels.*.name, 'user docs'))) uses: dbt-labs/actions/.github/workflows/open-issue-in-repo.yml@main with: issue_repository: "dbt-labs/docs.getdbt.com" issue_title: "Docs Changes Needed from ${{ github.event.repository.name }} Issue #${{ github.event.issue.number }}" issue_body: "At a minimum, update body to include a link to the page on docs.getdbt.com requiring updates and what part(s) of the page you would like to see updated." - secrets: inherit \ No newline at end of file + secrets: inherit + \ No newline at end of file From c7ebbd357185aaff8c45599ff892d28592a47f06 Mon Sep 17 00:00:00 2001 From: McKnight-42 Date: Tue, 18 Jun 2024 13:39:28 -0500 Subject: [PATCH 4/7] whitespace --- .github/workflows/docs-issues.yml | 1 - 1 file changed, 1 deletion(-) diff --git a/.github/workflows/docs-issues.yml b/.github/workflows/docs-issues.yml index be1dc0951..dc74b95eb 100644 --- a/.github/workflows/docs-issues.yml +++ b/.github/workflows/docs-issues.yml @@ -38,4 +38,3 @@ jobs: issue_title: "Docs Changes Needed from ${{ github.event.repository.name }} Issue #${{ github.event.issue.number }}" issue_body: "At a minimum, update body to include a link to the page on docs.getdbt.com requiring updates and what part(s) of the page you would like to see updated." secrets: inherit - \ No newline at end of file From d6ecf774dc5d36def926ea1c1b1e2e3a4e54eaa4 Mon Sep 17 00:00:00 2001 From: McKnight-42 Date: Thu, 20 Jun 2024 10:08:20 -0500 Subject: [PATCH 5/7] update to match bigquery --- .github/workflows/docs-issues.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/docs-issues.yml b/.github/workflows/docs-issues.yml index dc74b95eb..f49cf517c 100644 --- a/.github/workflows/docs-issues.yml +++ b/.github/workflows/docs-issues.yml @@ -31,7 +31,8 @@ jobs: # decide if it should run or not. if: | (github.event.issue.state == 'closed' && github.event.issue.state_reason == 'completed') && ( - (github.event.action == 'closed' && contains(github.event.issue.labels.*.name, 'user docs'))) + (github.event.action == 'closed' && contains(github.event.issue.labels.*.name, 'user docs')) || + (github.event.action == 'labeled' && github.event.label.name == 'user docs')) uses: dbt-labs/actions/.github/workflows/open-issue-in-repo.yml@main with: issue_repository: "dbt-labs/docs.getdbt.com" From 2a949f77f73c0a27dce03b63fe46602f0c7a8d8b Mon Sep 17 00:00:00 2001 From: McKnight-42 Date: Fri, 21 Jun 2024 11:37:19 -0500 Subject: [PATCH 6/7] pin numpy to below 2.0 new release --- dev-requirements.txt | 2 ++ 1 file changed, 2 insertions(+) diff --git a/dev-requirements.txt b/dev-requirements.txt index f86fb5ef4..f54bf272f 100644 --- a/dev-requirements.txt +++ b/dev-requirements.txt @@ -9,6 +9,8 @@ git+https://github.com/dbt-labs/dbt-adapters.git#subdirectory=dbt-tests-adapter ipdb~=0.13.13 pre-commit==3.7.0;python_version >="3.9" pre-commit==3.5.0;python_version <"3.9" +numpy<2.0 + # test freezegun~=1.3 From ae4a427a6bb0f816aa5e427fe03c813d3db01263 Mon Sep 17 00:00:00 2001 From: McKnight-42 Date: Fri, 21 Jun 2024 11:51:42 -0500 Subject: [PATCH 7/7] remove numpy pin for its own pr --- dev-requirements.txt | 2 -- 1 file changed, 2 deletions(-) diff --git a/dev-requirements.txt b/dev-requirements.txt index f54bf272f..f86fb5ef4 100644 --- a/dev-requirements.txt +++ b/dev-requirements.txt @@ -9,8 +9,6 @@ git+https://github.com/dbt-labs/dbt-adapters.git#subdirectory=dbt-tests-adapter ipdb~=0.13.13 pre-commit==3.7.0;python_version >="3.9" pre-commit==3.5.0;python_version <"3.9" -numpy<2.0 - # test freezegun~=1.3