diff --git a/.github/ISSUE_TEMPLATE/bug-report.md b/.github/ISSUE_TEMPLATE/bug-report.md new file mode 100644 index 0000000000..797eebfc25 --- /dev/null +++ b/.github/ISSUE_TEMPLATE/bug-report.md @@ -0,0 +1,50 @@ +--- +name: Bug Report +about: Report defective or unintentional behavior you've experienced. +title: "Brief summary of what bug or error was observed" +labels: 'type: bug' + +--- + + + +## Bug Description + +Please enter a detailed description of the bug, and any information about what +behavior you noticed and why it is defective or unintentional. + +## Example code (or command) + +```go +// example +``` + +## Stacktrace +``` +Any relevant stacktrace here. Be sure to filter sensitive information. +``` + +## How to reproduce + + 1. ? + 2. ? + +## Environment + +1. OS type and version: +2. Proxy version: diff --git a/.github/ISSUE_TEMPLATE/config.yml b/.github/ISSUE_TEMPLATE/config.yml new file mode 100644 index 0000000000..606ac37ab5 --- /dev/null +++ b/.github/ISSUE_TEMPLATE/config.yml @@ -0,0 +1,22 @@ +# Copyright 2022 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +blank_issues_enabled: false +contact_links: +- name: AlloyDB Issue tracker + url: https://cloud.google.com/support/docs/issue-trackers + about: Please use the AlloyDB Issue tracker for problems with AlloyDB itself. +- name: StackOverflow + url: https://stackoverflow.com/questions/tagged/google-alloydb + about: Please use the `google-alloydb` tag for questions on StackOverflow. diff --git a/.github/ISSUE_TEMPLATE/documentation-issue.md b/.github/ISSUE_TEMPLATE/documentation-issue.md new file mode 100644 index 0000000000..91a44ab2cf --- /dev/null +++ b/.github/ISSUE_TEMPLATE/documentation-issue.md @@ -0,0 +1,35 @@ +--- +name: Documentation Issue +about: Report wrong or missing information with the documentation in the repo. +title: "Brief summary of what is missing or incorrect" +labels: 'type: docs' + +--- + + +## Description +Provide a short description of what is missing or incorrect, as well as a link +to the specific location of the information. + +## Solution +What would you prefer the documentation say? Why would this information be more +accurate or helpful? + +## Additional Context +Please reference any other relevant issues, PRs, descriptions, or screenshots +here. diff --git a/.github/ISSUE_TEMPLATE/feature-request.md b/.github/ISSUE_TEMPLATE/feature-request.md new file mode 100644 index 0000000000..00190fdd1b --- /dev/null +++ b/.github/ISSUE_TEMPLATE/feature-request.md @@ -0,0 +1,34 @@ +--- +name: Feature Request +about: Suggest an idea for new or improved behavior. +title: "Brief summary of the proposed feature" +labels: 'type: feature request' + +--- + + +## Feature Description +A clear and concise description of what feature you would like to see, and why +it would be useful to have added. + +## Alternatives Considered +Are there any workaround or third party tools to replicate this behavior? Why +would adding this feature be preferred over them? + +## Additional Context +Please reference any other issues, PRs, descriptions, or screenshots here. diff --git a/.github/ISSUE_TEMPLATE/question.md b/.github/ISSUE_TEMPLATE/question.md new file mode 100644 index 0000000000..91f95e41ed --- /dev/null +++ b/.github/ISSUE_TEMPLATE/question.md @@ -0,0 +1,32 @@ +--- +name: Question +about: Questions on how something works or the best way to do something. +title: "Brief summary of your question" +labels: 'type: question' + +--- + + + +## Question +What's your question? Please provide as much relevant information as possible +to reduce turnaround time. + +## Additional Context +Please reference any other relevant issues, PRs, descriptions, or screenshots +here. diff --git a/.github/PULL_REQUEST_TEMPLATE.md b/.github/PULL_REQUEST_TEMPLATE.md new file mode 100644 index 0000000000..866842570d --- /dev/null +++ b/.github/PULL_REQUEST_TEMPLATE.md @@ -0,0 +1,17 @@ +## Change Description + +Please provide a detailed description on what changes your PR will have. + + +## Checklist + +- [ ] Make sure to open an issue as a + [bug/issue](https://github.com/GoogleCloudPlatform//issues/new/choose) + before writing your code! That way we can discuss the change, evaluate + designs, and agree on the general idea. +- [ ] Ensure the tests and linter pass +- [ ] Appropriate documentation is updated (if necessary) + +## Relevant issues: + +- Fixes # \ No newline at end of file diff --git a/.github/blunderbuss.yml b/.github/blunderbuss.yml new file mode 100644 index 0000000000..2610f78f81 --- /dev/null +++ b/.github/blunderbuss.yml @@ -0,0 +1,18 @@ +# Copyright 2022 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +assign_issues: + - enocom +assign_prs: + - enocom diff --git a/.github/header-checker-lint.yml b/.github/header-checker-lint.yml new file mode 100644 index 0000000000..54da35ebd0 --- /dev/null +++ b/.github/header-checker-lint.yml @@ -0,0 +1,22 @@ +# Copyright 2022 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +allowedCopyrightHolders: + - 'Google LLC' +allowedLicenses: + - 'Apache-2.0' +sourceFileExtensions: + - 'go' + - 'yaml' + - 'yml' diff --git a/.github/labels.yml b/.github/labels.yml new file mode 100644 index 0000000000..b3c48e012e --- /dev/null +++ b/.github/labels.yml @@ -0,0 +1,71 @@ +# Copyright 2022 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +- name: duplicate + color: ededed + description: "" + +- name: 'type: bug' + color: db4437 + description: Error or flaw in code with unintended results or allowing sub-optimal + usage patterns. +- name: 'type: cleanup' + color: c5def5 + description: An internal cleanup or hygiene concern. +- name: 'type: docs' + color: 0000A0 + description: Improvement to the documentation for an API. +- name: 'type: feature request' + color: c5def5 + description: ‘Nice-to-have’ improvement, new feature or different behavior or design. +- name: 'type: process' + color: c5def5 + description: A process-related concern. May include testing, release, or the like. +- name: 'type: question' + color: c5def5 + description: Request for information or clarification. + +- name: 'priority: p0' + color: b60205 + description: Highest priority. Critical issue. P0 implies highest priority. +- name: 'priority: p1' + color: ffa03e + description: Important issue which blocks shipping the next release. Will be fixed + prior to next release. +- name: 'priority: p2' + color: fef2c0 + description: Moderately-important priority. Fix may not be included in next release. +- name: 'priority: p3' + color: ffffc7 + description: Desirable enhancement or fix. May not be included in next release. + +- name: automerge + color: 00ff00 + description: Merge the pull request once unit tests and other checks pass. +- name: 'automerge: exact' + color: 8dd517 + description: Summon MOG for automerging, but approvals need to be against the latest + commit +- name: do not merge + color: d93f0b + description: Indicates a pull request not ready for merge, due to either quality + or timing. + +- name: 'autorelease: pending' + color: ededed + description: Release please needs to do its work on this. + +- name: 'autorelease: tagged' + color: ededed + description: Release please has completed a release for this. diff --git a/.github/renovate.json b/.github/renovate.json new file mode 100644 index 0000000000..7f278fa2c8 --- /dev/null +++ b/.github/renovate.json @@ -0,0 +1,24 @@ +{ + "extends": [ + "config:base", + ":semanticCommitTypeAll(chore)" + ], + "ignorePresets": [":semanticPrefixFixDepsChoreOthers"], + "prConcurrentLimit": 0, + "rebaseStalePrs": true, + "dependencyDashboard": true, + "semanticCommits": true, + "postUpdateOptions": [ + "gomodTidy" + ], + "packageRules": [ + { + "matchPackagePatterns": [".*"], + "addLabels": ["automerge"] + } + ], + "schedule": [ + "after 8am on Friday", + "before 12pm on Friday" + ] +} diff --git a/.github/workflows/cover.yaml b/.github/workflows/cover.yaml new file mode 100644 index 0000000000..5627643119 --- /dev/null +++ b/.github/workflows/cover.yaml @@ -0,0 +1,50 @@ +# Copyright 2022 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +name: code coverage +on: [pull_request] + +jobs: + build: + runs-on: ubuntu-latest + steps: + - name: Setup Go + uses: actions/setup-go@v3 + with: + go-version: "1.18" + + - name: Checkout base branch + uses: actions/checkout@v3 + with: + ref: ${{ github.base_ref }} + - name: Calculate base code coverage + run: | + go test -short -coverprofile current_cover.out ./... || true + export CUR_COVER=$(go tool cover -func current_cover.out | grep total | awk '{print substr($3, 1, length($3)-1)}') + echo "CUR_COVER=$CUR_COVER" >> $GITHUB_ENV + + - name: Checkout PR branch + uses: actions/checkout@v3 + - name: Calculate PR code coverage + run: | + go test -short -coverprofile pr_cover.out ./... || true + export PR_COVER=$(go tool cover -func pr_cover.out | grep total | awk '{print substr($3, 1, length($3)-1)}') + echo "PR_COVER=$PR_COVER" >> $GITHUB_ENV + + - name: Verify code coverage. If your reading this and the step has failed, please add tests to cover your changes. + run: | + go tool cover -func pr_cover.out + if [ "${{ env.PR_COVER }}" -lt "${{ env.CUR_COVER }}" ]; then + exit 1; + fi diff --git a/.github/workflows/labels.yaml b/.github/workflows/labels.yaml new file mode 100644 index 0000000000..bf3e60fa17 --- /dev/null +++ b/.github/workflows/labels.yaml @@ -0,0 +1,28 @@ +# Copyright 2022 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +name: Sync labels +on: + push: + branches: + - main + +jobs: + build: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v3 + - uses: micnncim/action-label-syncer@v1 + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} diff --git a/.github/workflows/lint.yaml b/.github/workflows/lint.yaml new file mode 100644 index 0000000000..8d34ff82e7 --- /dev/null +++ b/.github/workflows/lint.yaml @@ -0,0 +1,34 @@ +# Copyright 2022 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +name: lint +on: [pull_request] + +jobs: + build: + name: lint + runs-on: ubuntu-latest + steps: + - name: Setup Go + uses: actions/setup-go@v3 + with: + go-version: "1.18" + - name: Install goimports + run: go install golang.org/x/tools/cmd/goimports@latest + - name: Checkout code + uses: actions/checkout@v3 + run: goimports -d $(find . -type f -name *.go -not -path ./vendor/*) + - run: go mod tidy + - name: Verify no changes from goimports and go mod tidy. If you're reading this and the check has failed, run `goimports -w . && go mod tidy`. + run: git diff --exit-code diff --git a/.github/workflows/release-please.yaml b/.github/workflows/release-please.yaml new file mode 100644 index 0000000000..1caab3dd01 --- /dev/null +++ b/.github/workflows/release-please.yaml @@ -0,0 +1,28 @@ +# Copyright 2022 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +name: release-please +on: + push: + branches: + - main +jobs: + release-please: + runs-on: ubuntu-latest + steps: + - uses: GoogleCloudPlatform/release-please-action@v3.1.3 + with: + token: ${{ secrets.GITHUB_TOKEN }} + release-type: simple + package-name: alloydb-auth-proxy diff --git a/.github/workflows/tests.yaml b/.github/workflows/tests.yaml index b517c805cf..eb063fcb81 100644 --- a/.github/workflows/tests.yaml +++ b/.github/workflows/tests.yaml @@ -48,7 +48,6 @@ jobs: build: name: "unit tests" runs-on: ${{ matrix.os }} - environment: "Private Repos" strategy: matrix: os: [macos-latest, windows-latest, ubuntu-latest] @@ -62,4 +61,3 @@ jobs: - name: Run tests run: | go test -v -race -cover -short ./... -