diff --git a/.changes/unreleased/Dependency-20220826-011634.yaml b/.changes/unreleased/Dependency-20220831-013132.yaml similarity index 50% rename from .changes/unreleased/Dependency-20220826-011634.yaml rename to .changes/unreleased/Dependency-20220831-013132.yaml index aaa24014..f9ea5ca4 100644 --- a/.changes/unreleased/Dependency-20220826-011634.yaml +++ b/.changes/unreleased/Dependency-20220831-013132.yaml @@ -1,7 +1,7 @@ kind: Dependency -body: "Test 2" -time: 2022-08-26T01:16:34.00000Z +body: "dummy" +time: 2022-08-31T01:31:32.00000Z custom: Author: emmyoop Issue: 4904 - PR: 20 + PR: 23 diff --git a/.changes/unreleased/Dependency-20220831-013138.yaml b/.changes/unreleased/Dependency-20220831-013138.yaml new file mode 100644 index 00000000..1cc3cbe4 --- /dev/null +++ b/.changes/unreleased/Dependency-20220831-013138.yaml @@ -0,0 +1,7 @@ +kind: Dependency +body: "dummy" +time: 2022-08-31T01:31:38.00000Z +custom: + Author: emmyoop + Issue: 4904 + PR: 23 diff --git a/.changes/unreleased/Dependency-20220831-014159.yaml b/.changes/unreleased/Dependency-20220831-014159.yaml new file mode 100644 index 00000000..63cebc54 --- /dev/null +++ b/.changes/unreleased/Dependency-20220831-014159.yaml @@ -0,0 +1,7 @@ +kind: Dependency +body: "dummy" +time: 2022-08-31T01:41:59.00000Z +custom: + Author: emmyoop + Issue: 4904 + PR: 23 diff --git a/.changes/unreleased/Dependency-20220831-014336.yaml b/.changes/unreleased/Dependency-20220831-014336.yaml new file mode 100644 index 00000000..a8a7d68b --- /dev/null +++ b/.changes/unreleased/Dependency-20220831-014336.yaml @@ -0,0 +1,7 @@ +kind: Dependency +body: "dummy" +time: 2022-08-31T01:43:36.00000Z +custom: + Author: emmyoop + Issue: 4904 + PR: 24 diff --git a/.changes/unreleased/Dependency-20220831-032125.yaml b/.changes/unreleased/Dependency-20220831-032125.yaml new file mode 100644 index 00000000..2f3dd589 --- /dev/null +++ b/.changes/unreleased/Dependency-20220831-032125.yaml @@ -0,0 +1,7 @@ +kind: Dependency +body: "Emmyoop patch 5" +time: 2022-08-31T03:21:25.00000Z +custom: + Author: emmyoop + Issue: 4904 + PR: 36 diff --git a/.changes/unreleased/Dependency-20220831-180142.yaml b/.changes/unreleased/Dependency-20220831-180142.yaml new file mode 100644 index 00000000..18e577e8 --- /dev/null +++ b/.changes/unreleased/Dependency-20220831-180142.yaml @@ -0,0 +1,7 @@ +kind: "Dependency" +body: "change" +time: $(date +%Y-%m-%dT%H:%M:%S.00000Z) +custom: + Author: emmyoop + Issue: 4904 + PR: 41 diff --git a/.changes/unreleased/Dependency-20220906-135103.yaml b/.changes/unreleased/Dependency-20220906-135103.yaml new file mode 100644 index 00000000..d27b57a7 --- /dev/null +++ b/.changes/unreleased/Dependency-20220906-135103.yaml @@ -0,0 +1,7 @@ +kind: "Dependency" +body: "change" +time: 2022-09-06T13:51:03.00000Z +custom: + Author: emmyoop + Issue: + PR: 46 diff --git a/.changie.yaml b/.changie.yaml index 9b08a3ca..fcae30a2 100644 --- a/.changie.yaml +++ b/.changie.yaml @@ -2,29 +2,38 @@ changesDir: .changes unreleasedDir: unreleased headerPath: header.tpl.md versionHeaderPath: "" -versionFooterPath: "" changelogPath: CHANGELOG.md versionExt: md -versionFormat: '## {{.Version}} - {{.Time.Format "2006-01-02"}}' +versionFormat: '## changie_bot {{.Version}} - {{.Time.Format "January 02, 2006"}}' kindFormat: '### {{.Kind}}' -changeFormat: '* {{.Body}}' -headerFormat: "" -footerFormat: "" +changeFormat: '- {{.Body}} ([#{{.Custom.Issue}}](https://github.com/emmyoop/changie_bot/issues/{{.Custom.Issue}}), [#{{.Custom.PR}}](https://github.com/emmyoop/changie_bot/pull/{{.Custom.PR}}))' + kinds: -- label: Added -- label: Changed -- label: Deprecated -- label: Removed -- label: Fixed -- label: Security + - label: Breaking Changes + - label: Features + - label: Fixes + - label: Docs + changeFormat: '- {{.Body}} ([dbt-docs/#{{.Custom.Issue}}](https://github.com/dbt-labs/dbt-docs/issues/{{.Custom.Issue}}), [dbt-docs/#{{.Custom.PR}}](https://github.com/dbt-labs/dbt-docs/pull/{{.Custom.PR}}))' + - label: Under the Hood + - label: Dependencies + changeFormat: '- {{.Body}} ({{if ne .Custom.Issue ""}}[#{{.Custom.Issue}}](https://github.com/dbt-labs/dbt-core/issues/{{.Custom.Issue}}), {{end}}[#{{.Custom.PR}}](https://github.com/dbt-labs/dbt-core/pull/{{.Custom.PR}}))' + - label: Security + changeFormat: '- {{.Body}} ({{if ne .Custom.Issue ""}}[#{{.Custom.Issue}}](https://github.com/dbt-labs/dbt-core/issues/{{.Custom.Issue}}), {{end}}[#{{.Custom.PR}}](https://github.com/dbt-labs/dbt-core/pull/{{.Custom.PR}}))' + + +newlines: + afterChangelogHeader: 1 + afterKind: 1 + afterChangelogVersion: 1 + beforeKind: 1 + endOfVersion: 1 + custom: -- key: Field 1 - label: String Field +- key: Author + label: GitHub Username(s) (separated by a single space if multiple) type: string -- key: Field 2 - label: Int Field - type: int -- key: Field 3 - label: Enum Field - type: enum - enumOptions: ["a", "b"] + minLength: 3 +- key: Issue + label: GitHub Issue Number + type: string + minInt: 3 diff --git a/.github/ISSUE_TEMPLATE/bug-report.yml b/.github/ISSUE_TEMPLATE/bug-report.yml new file mode 100644 index 00000000..42a50b38 --- /dev/null +++ b/.github/ISSUE_TEMPLATE/bug-report.yml @@ -0,0 +1,97 @@ +name: 🐞 Bug +description: Report a bug or an issue you've found with dbt +title: "[Bug] " +labels: ["bug", "triage"] +body: + - type: markdown + attributes: + value: | + Thanks for taking the time to fill out this bug report! + - type: checkboxes + attributes: + label: Is this a new bug in dbt-core? + description: > + In other words, is this an error, flaw, failure or fault in our software? + + If this is a bug that broke existing functionality that used to work, please open a regression issue. + If this is a bug in an adapter plugin, please open an issue in the adapter's repository. + If this is a bug experienced while using dbt Cloud, please report to [support](mailto:support@getdbt.com). + If this is a request for help or troubleshooting code in your own dbt project, please join our [dbt Community Slack](https://www.getdbt.com/community/join-the-community/) or open a [Discussion question](https://github.com/dbt-labs/docs.getdbt.com/discussions). + + Please search to see if an issue already exists for the bug you encountered. + options: + - label: I believe this is a new bug in dbt-core + required: true + - label: I have searched the existing issues, and I could not find an existing issue for this bug + required: true + - type: textarea + attributes: + label: Current Behavior + description: A concise description of what you're experiencing. + validations: + required: true + - type: textarea + attributes: + label: Expected Behavior + description: A concise description of what you expected to happen. + validations: + required: true + - type: textarea + attributes: + label: Steps To Reproduce + description: Steps to reproduce the behavior. + placeholder: | + 1. In this environment... + 2. With this config... + 3. Run '...' + 4. See error... + validations: + required: true + - type: textarea + id: logs + attributes: + label: Relevant log output + description: | + If applicable, log output to help explain your problem. + render: shell + validations: + required: false + - type: textarea + attributes: + label: Environment + description: | + examples: + - **OS**: Ubuntu 20.04 + - **Python**: 3.9.12 (`python3 --version`) + - **dbt-core**: 1.1.1 (`dbt --version`) + value: | + - OS: + - Python: + - dbt: + render: markdown + validations: + required: false + - type: dropdown + id: database + attributes: + label: Which database adapter are you using with dbt? + description: If the bug is specific to the database or adapter, please open the issue in that adapter's repository instead + multiple: true + options: + - postgres + - redshift + - snowflake + - bigquery + - spark + - other (mention it in "Additional Context") + validations: + required: false + - type: textarea + attributes: + label: Additional Context + description: | + Links? References? Anything that will give us more context about the issue you are encountering! + + Tip: You can attach images or log files by clicking this area to highlight it and then dragging files in. + validations: + required: false diff --git a/.github/ISSUE_TEMPLATE/bug_report.md b/.github/ISSUE_TEMPLATE/bug_report.md new file mode 100644 index 00000000..dd84ea78 --- /dev/null +++ b/.github/ISSUE_TEMPLATE/bug_report.md @@ -0,0 +1,38 @@ +--- +name: Bug report +about: Create a report to help us improve +title: '' +labels: '' +assignees: '' + +--- + +**Describe the bug** +A clear and concise description of what the bug is. + +**To Reproduce** +Steps to reproduce the behavior: +1. Go to '...' +2. Click on '....' +3. Scroll down to '....' +4. See error + +**Expected behavior** +A clear and concise description of what you expected to happen. + +**Screenshots** +If applicable, add screenshots to help explain your problem. + +**Desktop (please complete the following information):** + - OS: [e.g. iOS] + - Browser [e.g. chrome, safari] + - Version [e.g. 22] + +**Smartphone (please complete the following information):** + - Device: [e.g. iPhone6] + - OS: [e.g. iOS8.1] + - Browser [e.g. stock browser, safari] + - Version [e.g. 22] + +**Additional context** +Add any other context about the problem here. diff --git a/.github/ISSUE_TEMPLATE/config.yml b/.github/ISSUE_TEMPLATE/config.yml new file mode 100644 index 00000000..ca13b07b --- /dev/null +++ b/.github/ISSUE_TEMPLATE/config.yml @@ -0,0 +1,23 @@ +blank_issues_enabled: false +contact_links: + - name: Ask the community for help + url: https://github.com/dbt-labs/docs.getdbt.com/discussions + about: Need help troubleshooting? Check out our guide on how to ask + - name: Contact dbt Cloud support + url: mailto:support@getdbt.com + about: Are you using dbt Cloud? Contact our support team for help! + - name: Participate in Discussions + url: https://github.com/dbt-labs/dbt-core/discussions + about: Do you have a Big Idea for dbt? Read open discussions, or start a new one + - name: Create an issue for dbt-redshift + url: https://github.com/dbt-labs/dbt-redshift/issues/new/choose + about: Report a bug or request a feature for dbt-redshift + - name: Create an issue for dbt-bigquery + url: https://github.com/dbt-labs/dbt-bigquery/issues/new/choose + about: Report a bug or request a feature for dbt-bigquery + - name: Create an issue for dbt-snowflake + url: https://github.com/dbt-labs/dbt-snowflake/issues/new/choose + about: Report a bug or request a feature for dbt-snowflake + - name: Create an issue for dbt-spark + url: https://github.com/dbt-labs/dbt-spark/issues/new/choose + about: Report a bug or request a feature for dbt-spark diff --git a/.github/ISSUE_TEMPLATE/feature-request.yml b/.github/ISSUE_TEMPLATE/feature-request.yml new file mode 100644 index 00000000..a8b0b6e8 --- /dev/null +++ b/.github/ISSUE_TEMPLATE/feature-request.yml @@ -0,0 +1,59 @@ +name: ✨ Feature +description: Propose a straightforward extension of dbt functionality +title: "[Feature] <title>" +labels: ["enhancement", "triage"] +body: + - type: markdown + attributes: + value: | + Thanks for taking the time to fill out this feature request! + - type: checkboxes + attributes: + label: Is this your first time submitting a feature request? + description: > + We want to make sure that features are distinct and discoverable, + so that other members of the community can find them and offer their thoughts. + + Issues are the right place to request straightforward extensions of existing dbt functionality. + For "big ideas" about future capabilities of dbt, we ask that you open a + [discussion](https://github.com/dbt-labs/dbt-core/discussions) in the "Ideas" category instead. + options: + - label: I have read the [expectations for open source contributors](https://docs.getdbt.com/docs/contributing/oss-expectations) + required: true + - label: I have searched the existing issues, and I could not find an existing issue for this feature + required: true + - label: I am requesting a straightforward extension of existing dbt functionality, rather than a Big Idea better suited to a discussion + required: true + - type: textarea + attributes: + label: Describe the feature + description: A clear and concise description of what you want to happen. + validations: + required: true + - type: textarea + attributes: + label: Describe alternatives you've considered + description: | + A clear and concise description of any alternative solutions or features you've considered. + validations: + required: false + - type: textarea + attributes: + label: Who will this benefit? + description: | + What kind of use case will this feature be useful for? Please be specific and provide examples, this will help us prioritize properly. + validations: + required: false + - type: input + attributes: + label: Are you interested in contributing this feature? + description: Let us know if you want to write some code, and how we can help. + validations: + required: false + - type: textarea + attributes: + label: Anything else? + description: | + Links? References? Anything that will give us more context about the feature you are suggesting! + validations: + required: false diff --git a/.github/ISSUE_TEMPLATE/regression-report.yml b/.github/ISSUE_TEMPLATE/regression-report.yml new file mode 100644 index 00000000..5dfceedb --- /dev/null +++ b/.github/ISSUE_TEMPLATE/regression-report.yml @@ -0,0 +1,93 @@ +name: ☣️ Regression +description: Report a regression you've observed in a newer version of dbt +title: "[Regression] <title>" +labels: ["bug", "regression", "triage"] +body: + - type: markdown + attributes: + value: | + Thanks for taking the time to fill out this regression report! + - type: checkboxes + attributes: + label: Is this a regression in a recent version of dbt-core? + description: > + A regression is when documented functionality works as expected in an older version of dbt-core, + and no longer works after upgrading to a newer version of dbt-core + options: + - label: I believe this is a regression in dbt-core functionality + required: true + - label: I have searched the existing issues, and I could not find an existing issue for this regression + required: true + - type: textarea + attributes: + label: Current Behavior + description: A concise description of what you're experiencing. + validations: + required: true + - type: textarea + attributes: + label: Expected/Previous Behavior + description: A concise description of what you expected to happen. + validations: + required: true + - type: textarea + attributes: + label: Steps To Reproduce + description: Steps to reproduce the behavior. + placeholder: | + 1. In this environment... + 2. With this config... + 3. Run '...' + 4. See error... + validations: + required: true + - type: textarea + id: logs + attributes: + label: Relevant log output + description: | + If applicable, log output to help explain your problem. + render: shell + validations: + required: false + - type: textarea + attributes: + label: Environment + description: | + examples: + - **OS**: Ubuntu 20.04 + - **Python**: 3.9.12 (`python3 --version`) + - **dbt-core (working version)**: 1.1.1 (`dbt --version`) + - **dbt-core (regression version)**: 1.2.0 (`dbt --version`) + value: | + - OS: + - Python: + - dbt (working version): + - dbt (regression version): + render: markdown + validations: + required: true + - type: dropdown + id: database + attributes: + label: Which database adapter are you using with dbt? + description: If the regression is specific to the database or adapter, please open the issue in that adapter's repository instead + multiple: true + options: + - postgres + - redshift + - snowflake + - bigquery + - spark + - other (mention it in "Additional Context") + validations: + required: false + - type: textarea + attributes: + label: Additional Context + description: | + Links? References? Anything that will give us more context about the issue you are encountering! + + Tip: You can attach images or log files by clicking this area to highlight it and then dragging files in. + validations: + required: false diff --git a/.github/ISSUE_TEMPLATE/some.yml b/.github/ISSUE_TEMPLATE/some.yml new file mode 100644 index 00000000..e69de29b diff --git a/.github/workflows/.trigger_issue_comments.yml b/.github/workflows/.trigger_issue_comments.yml deleted file mode 100644 index 890e33d0..00000000 --- a/.github/workflows/.trigger_issue_comments.yml +++ /dev/null @@ -1,21 +0,0 @@ -name: Update Triage Label - -on: issue_comment - -defaults: - run: - shell: bash - -permissions: - issues: write - -jobs: - triage_label: - if: contains(github.event.issue.labels.*.name, 'awaiting_response') - runs-on: ubuntu-latest - steps: - - name: initial labeling - uses: andymckay/labeler@master - with: - add-labels: "triage" - remove-labels: "awaiting_response" diff --git a/.github/workflows/changie_bot_testing.yml b/.github/workflows/changie_bot_testing.yml index 0d624657..7c3ac553 100644 --- a/.github/workflows/changie_bot_testing.yml +++ b/.github/workflows/changie_bot_testing.yml @@ -47,10 +47,17 @@ jobs: steps: + - name: generate custom fields + id: custom + shell: bash + run: | + CUSTOM_FIELDS='{"Author": "emmyoop", "Issue": "1234"}' + echo "fields=$CUSTOM_FIELDS" >> $GITHUB_OUTPUT + - name: Create and commit changelog on bot PR if: ${{ contains(github.event.pull_request.labels.*.name, matrix.label) }} id: bot_changelog - uses: emmyoop/changie_bot@main + uses: emmyoop/changie_bot@er/use-changie-cli with: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} commit_author_name: "Github Build Bot" @@ -58,4 +65,4 @@ jobs: commit_message: "Add automated changelog yaml from template for bot PR" changie_kind: ${{ matrix.changie_kind }} label: ${{ matrix.label }} - custom_changelog_string: "custom:\n Author: ${{ github.event.pull_request.user.login }}\n Issue: 4904\n PR: ${{ github.event.pull_request.number }}" \ No newline at end of file + custom_changelog_json: ${{ steps.custom.outputs.fields }} diff --git a/.github/workflows/github_output_testing.yml b/.github/workflows/github_output_testing.yml new file mode 100644 index 00000000..bac57471 --- /dev/null +++ b/.github/workflows/github_output_testing.yml @@ -0,0 +1,82 @@ +# **what?** +# Testing formatting with $GITHUB_OUTPUT + +name: Test GITHUB_OUTPUT + +on: + workflow_dispatch: + +permissions: read-all + +jobs: + set-vars: + runs-on: ubuntu-latest + outputs: + package_name: ${{ steps.variables.outputs.package_name }} + steps: + - name: Set output value + id: variables + run: | + echo "package_name=dashes-are-cool" >> $GITHUB_OUTPUT + + transform-vars-1: + runs-on: ubuntu-latest + needs: [set-vars] + outputs: + build_arg_name1: ${{ steps.variables.outputs.build_arg_name1 }} + steps: + - name: Print Var + run: | + echo "transform-vars-1" + echo "${{ needs.set-vars.outputs.package_name }}" + + - name: Set output value + id: variables + run: | + echo "build_arg_name1="$(echo ${{ needs.set-vars.outputs.package_name }} | sed 's/\-/_/g') >> $GITHUB_OUTPUT + + transform-vars-2: + runs-on: ubuntu-latest + needs: [set-vars] + outputs: + build_arg_name2: ${{ steps.variables.outputs.build_arg_name2 }} + steps: + - name: Print Var + run: | + echo "transform-vars-2" + echo "${{ needs.set-vars.outputs.package_name }}" + + - name: Set output value + id: variables + run: | + echo "build_arg_name2=$(echo ${{ needs.set-vars.outputs.package_name }} | sed 's/\-/_/g')" >> $GITHUB_OUTPUT + + + transform-vars-3: + runs-on: ubuntu-latest + needs: [set-vars] + outputs: + build_arg_name3: ${{ steps.variables.outputs.build_arg_name3 }} + steps: + - name: Print Var + run: | + echo "transform-vars-3" + echo "${{ needs.set-vars.outputs.package_name }}" + + - name: Set output value + id: variables + run: | + PACKAGE_NAME=$(echo ${{ needs.set-vars.outputs.package_name }} | sed 's/\-/_/g') + echo "build_arg_name3=$PACKAGE_NAME" >> $GITHUB_OUTPUT + + + print-vars: + runs-on: ubuntu-latest + needs: [transform-vars-1, transform-vars-2, transform-vars-3] + steps: + - name: Print Vars + id: print + run: | + echo "${{ needs.transform-vars-1.outputs.build_arg_name1 }}" + echo "${{ needs.transform-vars-2.outputs.build_arg_name2 }}" + echo "${{ needs.transform-vars-3.outputs.build_arg_name3 }}" diff --git a/.github/workflows/github_release_test.yml b/.github/workflows/github_release_test.yml new file mode 100644 index 00000000..d7ccb760 --- /dev/null +++ b/.github/workflows/github_release_test.yml @@ -0,0 +1,116 @@ +# **what?** +# Release workflow provides the following steps: +# - checkout the given commit; +# - validate version in sources and changelog file for given version; +# - bump the version and generate a changelog if needed; +# - merge all changes to the target branch if needed; +# - run unit and integration tests against given commit; +# - build and package that SHA; +# - release it to GitHub and PyPI with that specific build; +# +# **why?** +# Ensure an automated and tested release process +# +# **when?** +# This workflow can be run manually on demand or can be called by other workflows + +name: Release to GitHub and PyPI + +on: + workflow_dispatch: + inputs: + sha: + description: "The commit sha for the release" + type: string + required: true + version_number: + description: "The release version number (i.e. 1.0.0b1)" + type: string + required: true + changelog_path: + description: "Path to changelog file" + type: string + default: ".changes/1.6.0.md" + required: true + test_run: + description: "Test run (Publish release as draft)" + type: boolean + default: false + required: false + workflow_call: + inputs: + sha: + description: "The commit sha for the release" + type: string + required: true + version_number: + description: "The release version number (i.e. 1.0.0b1)" + type: string + required: true + changelog_path: + description: "Path to changelog file" + type: string + default: ".changes/1.6.0.md" + required: true + test_run: + description: "Test run (Publish release as draft)" + type: boolean + default: false + required: false + + +permissions: + contents: write # this is the permission that allows creating a new release + +defaults: + run: + shell: bash + +jobs: + log-inputs: + name: Log Inputs + runs-on: ubuntu-latest + steps: + - name: "[DEBUG] Print Variables" + run: | + echo The last commit sha in the release: ${{ inputs.sha }} + echo The release version number: ${{ inputs.version_number }} + echo Changelog path: ${{ inputs.changelog_path }} + echo Test Run: ${{ inputs.test_run }} + + generate-fake-artifact: + name: Generate fake artifact to release + runs-on: ubuntu-latest + + steps: + - name: "Create dummy changelog" + run: | + echo "This is the fancy changelog!" > "${{ inputs.changelog_path}}" + + - name: "Create dummy artifact" + run: | + echo "This is the atrifact!" > "dist/my_artifact.txt" + + - name: "Upload Build Artifact - ${{ inputs.version_number }}" + uses: actions/upload-artifact@v3 + with: + name: ${{ inputs.version_number }} + path: | + ${{ inputs.changelog_path }} + ./dist/ + !dist/dbt-${{ inputs.version_number }}.tar.gz + retention-days: 5 + + github-release: + name: GitHub Release + needs: [generate-fake-artifact] + + uses: dbt-labs/dbt-release/.github/workflows/github-release.yml@er/track-latest + + with: + sha: ${{ inputs.sha }} + version_number: ${{ inputs.version_number }} + changelog_path: ${{ inputs.changelog_path }} + test_run: ${{ inputs.test_run }} + + diff --git a/.github/workflows/label-printing.yml b/.github/workflows/label-printing.yml new file mode 100644 index 00000000..970c6a63 --- /dev/null +++ b/.github/workflows/label-printing.yml @@ -0,0 +1,56 @@ +# **what?** +# grab multiple labels off an issue and run as a matrix + +name: Label Play + +on: + issues: + types: [opened, labeled] + +permissions: + issues: read + +jobs: + + find-labels: + runs-on: ubuntu-latest + outputs: + labels: ${{ steps.generate-labels.outputs.labels }} + steps: + - name: Generate Labels + id: generate-labels + run: | + LABELS='${{ toJSON(github.event.issue.labels.*.name) }}' + echo "labels<<EOF" >> $GITHUB_OUTPUT + echo "${LABELS}" >> $GITHUB_OUTPUT + echo "EOF" >> $GITHUB_OUTPUT + + print-labels-json-matrix: + runs-on: ubuntu-latest + needs: + - find-labels + strategy: + matrix: + label: ${{ fromJSON(needs.find-labels.outputs.labels) }} + steps: + - name: "[DEBUG] - Print Job Inputs" + shell: bash + id: echo_inputs + run: | + echo "all variables defined as ouputs in previous jobs" + echo "Running for label: ${{ matrix.label }}" + + print-labels-list: + runs-on: ubuntu-latest + needs: + - find-labels + steps: + - name: "[DEBUG] - Print Job Inputs" + shell: bash + id: echo_inputs + run: | + echo "all variables defined as ouputs in previous jobs" + echo "fromJSON label: ${{ fromJSON(needs.find-labels.outputs.labels) }}" + echo "Plain text label: ${{ needs.find-labels.outputs.labels }}" + + diff --git a/.github/workflows/open_issues.yml b/.github/workflows/open_issues.yml new file mode 100644 index 00000000..47bf54fc --- /dev/null +++ b/.github/workflows/open_issues.yml @@ -0,0 +1,47 @@ +name: Open issues in another repo when a PR is labeled +run-name: "Open an issue in action_testing when a merged PR is labeled user doc" + +on: + pull_request: + types: [closed, labeled] + +defaults: + run: + shell: bash + +permissions: + issues: write # opens new issues + pull-requests: write # comments on PRs + + +jobs: + generate_body: + if: contains( github.event.pull_request.labels.*.name, 'needs-docs') && github.event.pull_request.merged == true + runs-on: ubuntu-latest + outputs: + issue_body: ${{ steps.set_body.outputs.issue_body }} + steps: + - name: Get issue title + id: set_lines + run: | + echo "first_line=### Link to the page on docs.getdbt.com requiring updates " >> $GITHUB_OUTPUT + echo "second_line=### What part(s) of the page would you like to see updated? " >> $GITHUB_OUTPUT + echo "third_line=### Additional information " >> $GITHUB_OUTPUT + + - name: Set issue body + id: set_body + run: | + issue_body="${{steps.set_lines.outputs.first_line }}\n\n${{steps.set_lines.outputs.second_line }}\n\n${{steps.set_lines.outputs.third_line }}" + echo $issue_body + echo "issue_body=$issue_body" >> $GITHUB_OUTPUT + + open_issues: + needs: [generate_body] + uses: dbt-labs/actions/.github/workflows/open-issue-in-repo.yml@er/docs-issue + with: + issue_repository: "emmyoop/action_testing" + issue_title: "This is my title" + issue_body: "${{needs.generate_body.outputs.issue_body }}" + issue_labels: "needs-docs,bug" + secrets: + FISHTOWN_BOT_PAT: ${{ secrets.FISHTOWN_BOT_PAT }} \ No newline at end of file diff --git a/.github/workflows/playground.yml b/.github/workflows/playground.yml new file mode 100644 index 00000000..3e6acbd3 --- /dev/null +++ b/.github/workflows/playground.yml @@ -0,0 +1,55 @@ +name: Playground for Workflow Testing + +on: + workflow_dispatch: + inputs: + sha: + description: 'The last commit sha in the release' + required: true + version_number: + description: 'The release version number (i.e. 1.0.0b1)' + required: true + default: 2.2.2 + +defaults: + run: + shell: bash + +jobs: + + get_release_by_tag: + name: Test GH CLI find release by tag + runs-on: ubuntu-latest + + steps: + - name: Find Release by tag + id: cli_tag + run: | + release_commit=`gh release view v${{ inputs.version_number }} --json targetCommitish` + echo "::set-output name=releaseJson::$release_commit" + + get_release_by_commit: + name: Test GH CLI find by commit + runs-on: ubuntu-latest + + steps: + - name: Find Release by tag + id: cli_tag + run: | + release_commit=`gh release view v${{ inputs.version_number }} --json targetCommitish` + echo "::set-output name=releaseJson::$release_commit" + + create_release: + name: Test GH CLI Release Creation + runs-on: ubuntu-latest + + steps: + - name: Find Release by tag + id: cli_tag + run: | + VERSION=v${{ version_number }} + CHANGELOG_FILE=CHANGELOG.md + TITLE="my_repo v1.2.3" + PRERELEASE='' + gh release create $VERSION -t $TITLE -F $CHANGELOG_FILE --target ${{ input.sha }} $PRERELEASE + gh release create v1.2.3 -t "my_repo v1.2.3" -F CHANGELOG.md --target ${{ input.sha }} '' \ No newline at end of file diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 06f2fc1e..7c833417 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -1,4 +1,4 @@ -name: "Build and Release" +name: "Build and Release via Action" on: workflow_dispatch: diff --git a/.github/workflows/team_membership.yml b/.github/workflows/team_membership.yml new file mode 100644 index 00000000..9b43c907 --- /dev/null +++ b/.github/workflows/team_membership.yml @@ -0,0 +1,22 @@ +name: "Return Team Membership" + +on: + workflow_dispatch: + +permissions: read-all + +env: + ORG: rockmans + TEAM: core + + +jobs: + job_1: + runs-on: ubuntu-latest + + steps: + - name: Set Core Team Membership for Changie Contributors exclusion + run: | + response=$(gh api -H "Accept: application/vnd.github+json" /orgs/{{env.ORG}}/teams/{{env.TEAM}}/members) + echo $response + echo 'CHANGIE_CORE_TEAM=?' >> $GITHUB_ENV diff --git a/.github/workflows/testing_vars.yml b/.github/workflows/testing_vars.yml new file mode 100644 index 00000000..5c01f2d9 --- /dev/null +++ b/.github/workflows/testing_vars.yml @@ -0,0 +1,47 @@ + + + +name: "Testing Passing Around Variables" + +on: + workflow_dispatch: + + +permissions: read-all + +jobs: + job_1: + runs-on: ubuntu-latest + outputs: + issueId: ${{ steps.extract.outputs.issueId }} + SET_TITLE: ${{ steps.extract.outputs.SET_TITLE }} + + steps: + - name: Set output + id: extract + env: + TITLE: "[CT-1428] just testing" + run: | + issueId=$(echo -n "${{env.TITLE}}" | awk '{print $1}' | awk -F'[][]' '{print $2}') + echo "issueId=$issueId" >> $GITHUB_OUTPUT + echo "SET_TITLE="${{env.TITLE}} >> $GITHUB_OUTPUT + echo "Title: ${{env.TITLE}}" + echo "issueId: $issueId" + - name: Print output + id: echo + run: | + echo "Title: ${{env.SET_TITLE}}" + echo "Issue ID: ${{ steps.extract.outputs.issueId }}" + + job_2: + runs-on: ubuntu-latest + needs: job_1 + steps: + - name: "Print Job 1 Outputs" + shell: bash + id: echo_inputs + run: | + echo "all variables defined as ouputs in previous jobs" + echo "Issue ID: ${{ needs.job_1.outputs.issueId }}" + echo "Issue ID: (env) ${{ env.issueId }}" + echo "SET_TITLE: ${{ env.SET_TITLE }}" diff --git a/.github/workflows/triage-labels.yml b/.github/workflows/triage-labels.yml new file mode 100644 index 00000000..66d626bb --- /dev/null +++ b/.github/workflows/triage-labels.yml @@ -0,0 +1,18 @@ +name: Update Triage Label Internal + +on: issue_comment + +defaults: + run: + shell: bash + +permissions: + issues: write + +jobs: + triage_label: + uses: dbt-labs/actions/.github/workflows/swap-labels.yml@er/add-labeler + with: + add_label: "triage" + remove_label: "awaiting_response" + secrets: inherit # this is only acceptable because we own the action we're calling \ No newline at end of file diff --git a/change_me.txt b/change_me.txt index 857b308f..a4576215 100644 --- a/change_me.txt +++ b/change_me.txt @@ -1 +1,2 @@ -This file changes! yep. \ No newline at end of file +This file changes! yep. +