-
Notifications
You must be signed in to change notification settings - Fork 1
chore: Initial file setup #1
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
Show all changes
24 commits
Select commit
Hold shift + click to select a range
ce182fd
go file
lantoli 0cb2a69
license
lantoli e2606a3
security
lantoli e0755b0
conduct
lantoli 8d718c1
contributing
lantoli 72f7984
readme
lantoli 7be3db1
license note
lantoli eb928aa
codeowners
lantoli cce1bed
changelog
lantoli a817952
issues workflow, same as TF
lantoli bb93762
release GHA
lantoli 4473eaa
main go file
lantoli 0b9ff1a
pr linter GHA
lantoli f2ff4ac
dependabot settings
lantoli 873b30f
stale GHA
lantoli 9782f45
PR template
lantoli 54fcec0
code-health GHA
lantoli eb86d68
git ignore
lantoli 8379258
readme code-health badge
lantoli 7004ec0
issue template
lantoli d8999f3
go linter
lantoli abf4579
simplify code-health
lantoli 5828fb3
wip comment
lantoli 3ca685a
makefile small refactor
lantoli File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
# Maintained by the MongoDB APIx-Integrations team | ||
* @mongodb-labs/APIx-Integrations |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,61 @@ | ||
name: Bug report | ||
description: Something unexpected happen? Report an error, crash, or an incorrect behavior here. | ||
title: "[Bug]: <your-title>" | ||
body: | ||
- type: markdown | ||
attributes: | ||
value: | | ||
Thank you for opening an issue. **These GitHub issues** are only for community reporting and assistance; as such, we don't have a guaranteed SLA. | ||
|
||
**If your issue relates to Terraform itself**, please open it in the [Terraform repository](https://github.com/hashicorp/terraform/issues). | ||
|
||
**If you have an active MongoDB Atlas Support contract**, the best way for us to assist you with the Terraform MongoDB Atlas Provider is through a support ticket. | ||
|
||
**Please note:** In order for us to provide the best experience in supporting our customers, we kindly ask to make sure that all the following sections are correctly filled with all the required information. | ||
Our support will prioritise issues that contain all the required information that follows the [one-click reproducible issues principle](../../README.md#one-click-reproducible-issues-principle). | ||
|
||
- type: checkboxes | ||
attributes: | ||
label: Is there an existing issue for this? | ||
description: Please search to see if an issue already exists for the bug you encountered. If the issue has been reported add a reaction, i.e. +1, to the issue. | ||
options: | ||
- label: I have searched the existing issues | ||
required: true | ||
|
||
- type: textarea | ||
id: current_behaviour | ||
attributes: | ||
label: Current Behavior | ||
description: A concise description of what you're experiencing. | ||
validations: | ||
required: true | ||
|
||
- type: textarea | ||
attributes: | ||
label: Steps To Reproduce | ||
description: Steps to reproduce the behaviour. | ||
placeholder: | | ||
1. In this environment... | ||
2. With this config... | ||
3. Run '...' | ||
4. See error... | ||
validations: | ||
required: true | ||
|
||
- type: textarea | ||
id: logs | ||
attributes: | ||
label: Logs | ||
description: Additional logs that can help us investigate the issue. This will be automatically formatted into code, so no need for backticks. | ||
render: txt | ||
validations: | ||
required: false | ||
|
||
- type: checkboxes | ||
id: terms | ||
attributes: | ||
label: Code of Conduct | ||
description: By submitting this issue, you agree to follow our [Code of Conduct](https://github.com/mongodb-labs/atlas-cli-plugin-terraform/blob/master/CODE_OF_CONDUCT.md) | ||
options: | ||
- label: I agree to follow this project's Code of Conduct | ||
required: true |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
blank_issues_enabled: true | ||
contact_links: | ||
- name: Terraform MongoDB Atlas Provider Feature Request | ||
url: https://feedback.mongodb.com/forums/924145-atlas?category_id=370723 | ||
about: Request a feature or up-vote an existing suggestion! | ||
- name: MongoDB Atlas Support | ||
url: https://support.mongodb.com/ | ||
about: Support is provided under MongoDB Atlas support plans. Please submit support questions within the Atlas UI. | ||
- name: MongoDB Atlas | ||
url: https://www.mongodb.com/cloud/atlas | ||
about: Learn more about MongoDB Atlas |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
{ | ||
"problemMatcher": [ | ||
{ | ||
"owner": "actionlint", | ||
"severity": "warning", | ||
"pattern": [ | ||
{ | ||
"regexp": "^(?:\\x1b\\[\\d+m)?(.+?)(?:\\x1b\\[\\d+m)*:(?:\\x1b\\[\\d+m)*(\\d+)(?:\\x1b\\[\\d+m)*:(?:\\x1b\\[\\d+m)*(\\d+)(?:\\x1b\\[\\d+m)*: (?:\\x1b\\[\\d+m)*(.+?)(?:\\x1b\\[\\d+m)* \\[(.+?)\\]$", | ||
"file": 1, | ||
"line": 2, | ||
"column": 3, | ||
"message": 4, | ||
"code": 5 | ||
} | ||
] | ||
} | ||
] | ||
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
version: 2 | ||
updates: | ||
- package-ecosystem: gomod | ||
directory: "/" | ||
schedule: | ||
interval: weekly | ||
day: tuesday | ||
commit-message: | ||
prefix: "chore" | ||
reviewers: | ||
- "mongodb-labs/apix-integrations" | ||
- package-ecosystem: github-actions | ||
directory: "/" | ||
schedule: | ||
interval: weekly | ||
day: tuesday | ||
commit-message: | ||
prefix: "chore" | ||
reviewers: | ||
- "mongodb-labs/apix-integrations" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
version: 1 | ||
labels: | ||
- label: "breaking-change" | ||
title: "!" | ||
- label: "enhancement" | ||
title: "feat:*" | ||
- label: "enhancement" | ||
title: "feature:*" | ||
- label: "bug" | ||
title: "fix:*" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
## Description | ||
|
||
Please include a summary of the fix/feature/change, including any relevant motivation and context. | ||
|
||
Link to any related issue(s): | ||
|
||
## Type of change: | ||
|
||
- [ ] Bug fix (non-breaking change which fixes an issue). Please, add the "bug" label to the PR. | ||
- [ ] New feature (non-breaking change which adds functionality). Please, add the "enhancement" label to the PR. A migration guide must be created or updated if the new feature will go in a major version. | ||
- [ ] Breaking change (fix or feature that would cause existing functionality to not work as expected). Please, add the "breaking change" label to the PR. A migration guide must be created or updated. | ||
- [ ] This change requires a documentation update | ||
- [ ] Documentation fix/enhancement | ||
|
||
## Required Checklist: | ||
|
||
- [ ] I have signed the [MongoDB CLA](https://www.mongodb.com/legal/contributor-agreement) | ||
- [ ] I have read the [contributing guides](https://github.com/mongodb-labs/atlas-cli-plugin-terraform/blob/master/CONTRIBUTING.md) | ||
- [ ] I have checked that this change does not generate any credentials and that **they are NOT accidentally logged anywhere**. | ||
- [ ] I have added tests that prove my fix is effective or that my feature works per HashiCorp requirements | ||
- [ ] I have added any necessary documentation (if appropriate) | ||
- [ ] I have run make fmt and formatted my code | ||
- [ ] If changes include deprecations or removals I have added appropriate changelog entries. | ||
- [ ] If changes include removal or addition of 3rd party GitHub actions, I updated our internal document. Reach out to the APIx Integration slack channel to get access to the internal document. | ||
|
||
## Further comments |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
name: 'Code Health' | ||
|
||
on: | ||
push: | ||
branches: | ||
- master | ||
pull_request: | ||
workflow_dispatch: | ||
|
||
jobs: | ||
build: | ||
runs-on: ubuntu-latest | ||
permissions: {} | ||
steps: | ||
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 | ||
- uses: actions/setup-go@3041bf56c941b39c61721a86cd11f3bb1338122a | ||
with: | ||
go-version-file: 'go.mod' | ||
- name: Build | ||
run: make build | ||
lint: | ||
runs-on: ubuntu-latest | ||
permissions: {} | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 | ||
- name: Install Go | ||
uses: actions/setup-go@3041bf56c941b39c61721a86cd11f3bb1338122a | ||
with: | ||
go-version-file: 'go.mod' | ||
cache: false # see https://github.com/golangci/golangci-lint-action/issues/807 | ||
- name: golangci-lint | ||
uses: golangci/golangci-lint-action@971e284b6050e8a5849b72094c50ab08da042db8 | ||
with: | ||
version: v1.63.4 # Also update GOLANGCI_VERSION variable in GNUmakefile when updating this version | ||
- name: actionlint | ||
run: | | ||
make tools | ||
echo "::add-matcher::.github/actionlint-matcher.json" | ||
actionlint -color | ||
shell: bash | ||
- name: shellcheck | ||
uses: bewuethr/shellcheck-action@d01912909579c4b1a335828b8fca197fbb8e0aa4 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,174 @@ | ||
--- | ||
name: Create JIRA ticket for new issues | ||
|
||
# Creates and updates jira tickets that sync with GitHub Issues events. | ||
on: | ||
issues: | ||
types: [opened, reopened, closed] | ||
jobs: | ||
jira_task: | ||
name: Create Jira issue | ||
if: github.event.action == 'opened' | ||
runs-on: ubuntu-latest | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.APIX_BOT_PAT }} | ||
steps: | ||
- name: Create JIRA ticket | ||
id: create | ||
shell: bash | ||
env: | ||
ISSUE_NUMBER: ${{ github.event.issue.number }} | ||
ISSUE_URL: ${{ github.event.issue.html_url }} | ||
JIRA_API_TOKEN: ${{ secrets.JIRA_API_TOKEN }} | ||
JIRA_ASSIGNEE: ${{ secrets.ASSIGNEE_JIRA_TICKET }} | ||
run: | | ||
json_response=$(curl --request POST \ | ||
--url 'https://jira.mongodb.org/rest/api/2/issue' \ | ||
--header 'Authorization: Bearer '"${JIRA_API_TOKEN}" \ | ||
--header 'Accept: application/json' \ | ||
--header 'Content-Type: application/json' \ | ||
--data '{ | ||
"fields": { | ||
"project": { | ||
"id": "10984" | ||
}, | ||
"summary": "HELP: GitHub Issue n. '"${ISSUE_NUMBER}"'", | ||
"issuetype": { | ||
"id": "12" | ||
}, | ||
"customfield_12751": [{ | ||
"id": "25550" | ||
}], | ||
"description": "This ticket tracks the following GitHub issue: '"${ISSUE_URL}"'.", | ||
"components": [ | ||
{ | ||
"id": "34035" | ||
} | ||
] | ||
} | ||
}') | ||
|
||
echo "Response: ${json_response}" | ||
|
||
JIRA_TICKET_ID=$(echo "${json_response}" | jq -r '.key') | ||
|
||
echo "The following JIRA ticket has been created: ${JIRA_TICKET_ID}" | ||
echo "jira-ticket-id=${JIRA_TICKET_ID}" >> "${GITHUB_OUTPUT}" | ||
- name: Add comment | ||
uses: peter-evans/create-or-update-comment@71345be0265236311c031f5c7866368bd1eff043 | ||
with: | ||
issue-number: ${{ github.event.issue.number }} | ||
body: | | ||
Thanks for opening this issue! Please make sure you've followed [our guidelines](https://github.com/mongodb/terraform-provider-mongodbatlas/issues/new?assignees=&labels=&projects=&template=Bug_Report.md) when opening the issue. In short, to help us reproduce the issue we need: | ||
- Terraform configuration file used to reproduce the issue | ||
- Terraform log files from the run where the issue occurred | ||
- Terraform Atlas provider version used to reproduce the issue | ||
- Terraform version used to reproduce the issue | ||
- Confirmation if Terraform OSS, Terraform Cloud, or Terraform Enterprise deployment | ||
|
||
The ticket [${{ steps.create.outputs.jira-ticket-id }}](https://jira.mongodb.org/browse/${{ steps.create.outputs.jira-ticket-id }}) was created for internal tracking. | ||
reopen_jira_ticket: | ||
name: Reopen JIRA ticket | ||
if: github.event.action == 'reopened' | ||
runs-on: ubuntu-latest | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.APIX_BOT_PAT }} | ||
steps: | ||
- name: Reopened JIRA ticket if exists | ||
run: | | ||
ISSUE_NUMBER=${{ github.event.issue.number }} | ||
JIRA_API_TOKEN=${{ secrets.JIRA_API_TOKEN }} | ||
|
||
JIRA_QUERY="project = CLOUDP AND issuetype = Story AND resolution = Declined AND text ~ \"HELP: GitHub Issue n. $ISSUE_NUMBER\"" | ||
|
||
# URL encode the query | ||
JIRA_URL=$(echo "$JIRA_QUERY" | jq -s -R -r @uri) | ||
|
||
json_response=$(curl -s --request GET \ | ||
--url "https://jira.mongodb.org/rest/api/2/search?fields=id&jql=${JIRA_URL}" \ | ||
--header 'Authorization: Bearer '"${JIRA_API_TOKEN}" \ | ||
--header 'Accept: application/json') | ||
|
||
JIRA_TICKET_ID=$(echo "${json_response}" | jq -r '.issues[0].id') | ||
if [ -z "$JIRA_TICKET_ID" ]; then | ||
echo "JIRA_TICKET_ID is not defined. Exiting the script." | ||
exit 1 | ||
fi | ||
|
||
JIRA_REOPENED_URL="https://jira.mongodb.org/rest/api/2/issue/${JIRA_TICKET_ID}/transitions" | ||
|
||
json_response=$(curl -s --request POST \ | ||
--url "${JIRA_REOPENED_URL}" \ | ||
--header 'Authorization: Bearer '"${JIRA_API_TOKEN}" \ | ||
--header 'Accept: application/json' \ | ||
--header 'Content-Type: application/json' \ | ||
--data '{ | ||
"transition": { | ||
"id": 3 | ||
}, | ||
"update": { | ||
"comment": [ | ||
{ | ||
"add": { | ||
"body": "The related GitHub issue was reopened. Updated via automated process." | ||
} | ||
} | ||
] | ||
} | ||
}') | ||
echo "Response: ${json_response}" | ||
close_jira_ticket: | ||
name: Close JIRA ticket | ||
if: github.event.action == 'closed' | ||
runs-on: ubuntu-latest | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.APIX_BOT_PAT }} | ||
steps: | ||
- name: Close JIRA ticket if exists | ||
run: | | ||
ISSUE_NUMBER=${{ github.event.issue.number }} | ||
JIRA_API_TOKEN=${{ secrets.JIRA_API_TOKEN }} | ||
|
||
JIRA_QUERY="project = CLOUDP AND issuetype = Story AND resolution = Unresolved AND text ~ \"HELP: GitHub Issue n. $ISSUE_NUMBER\"" | ||
|
||
# URL encode the query | ||
JIRA_URL=$(echo "$JIRA_QUERY" | jq -s -R -r @uri) | ||
|
||
json_response=$(curl -s --request GET \ | ||
--url "https://jira.mongodb.org/rest/api/2/search?fields=id&jql=${JIRA_URL}" \ | ||
--header 'Authorization: Bearer '"${JIRA_API_TOKEN}" \ | ||
--header 'Accept: application/json') | ||
|
||
JIRA_TICKET_ID=$(echo "${json_response}" | jq -r '.issues[0].id') | ||
if [ -z "$JIRA_TICKET_ID" ]; then | ||
echo "JIRA_TICKET_ID is not defined. Exiting the script." | ||
exit 1 | ||
fi | ||
|
||
JIRA_CLOSE_URL="https://jira.mongodb.org/rest/api/2/issue/${JIRA_TICKET_ID}/transitions" | ||
|
||
json_response=$(curl -s --request POST \ | ||
--url "${JIRA_CLOSE_URL}" \ | ||
--header 'Authorization: Bearer '"${JIRA_API_TOKEN}" \ | ||
--header 'Accept: application/json' \ | ||
--header 'Content-Type: application/json' \ | ||
--data '{ | ||
"transition": { | ||
"id": 1371 | ||
}, | ||
"update": { | ||
"comment": [ | ||
{ | ||
"add": { | ||
"body": "The related GitHub issue was closed. Resolved via automated process." | ||
} | ||
} | ||
] | ||
}, | ||
"fields": { | ||
"resolution": { | ||
"name": "Declined" | ||
} | ||
} | ||
}') | ||
echo "Response: ${json_response}" |
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What is this for?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
like in TF, it's for the actionlinter in code-health to show the errors inline in the files in GH UI, more info: https://github.com/actions/toolkit/blob/main/docs/problem-matchers.md