Skip to content
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

Remove generate-schema and branch protection actions #2457

Merged
merged 3 commits into from
Jun 26, 2024
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
116 changes: 1 addition & 115 deletions .github/workflows/pr-merged.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,30 +30,12 @@ jobs:
fetch-depth: 0

- name: Setup workspace
uses: './.github/actions/bootstrap'
uses: "./.github/actions/bootstrap"

- name: Generate UUIDs for quickstarts
id: generate-uuids
run: cd utils && yarn generate-uuids

- name: Temporarily disable branch protections
id: disable-branch-protection
if: always()
uses: actions/github-script@v6
with:
github-token: ${{ secrets.OPENSOURCE_BOT_TOKEN }}
script: |
const result = await github.rest.repos.updateBranchProtection({
owner: context.repo.owner,
repo: context.repo.repo,
branch: 'release',
required_status_checks: null,
restrictions: null,
enforce_admins: null,
required_pull_request_reviews: null
})
console.log("Result:", result)

- name: Commit changes
id: commit-changes
run: |
Expand All @@ -69,99 +51,3 @@ jobs:
- name: Push Commit
if: env.commit == 'true'
run: git push origin HEAD

- name: Re-enable branch protections
id: enable-branch-protection
if: always()
uses: actions/github-script@v6
with:
github-token: ${{ secrets.OPENSOURCE_BOT_TOKEN }}
script: |
const result = await github.rest.repos.updateBranchProtection({
owner: context.repo.owner,
repo: context.repo.repo,
branch: 'release',
required_status_checks: {
strict: true,
contexts: [
'Validation / Image count and extension compliance',
'Validation / Ensure icons exist',
'Validation / Install plan ids exist',
'Validation / Data source ids exist',
'Validation / Install plan schema compliance',
'Validation / Data source schema compliance',
'Validation / Quickstart id are unique',
'Validation / Validate Quickstart Schema',
'Validation / Quickstart dashboard name is unique'
]
},
restrictions: {
"users":[],
"teams":[],
"apps":[]
},
enforce_admins: true,
required_pull_request_reviews: {
dismiss_stale_reviews: true,
required_approving_review_count: 1,
dismissal_restrictions: {
users: [],
teams: []
}
}
})
console.log("Result:", result)

# get-pr-number:
# name: Get PR number
# runs-on: ubuntu-latest
# outputs:
# pr-number: ${{ steps.output_pr_number.outputs.pr-number }}
# steps:
# - name: Download artifact
# uses: dawidd6/action-download-artifact@v2
# with:
# workflow: submit_gate.yml
# run_id: ${{ github.event.workflow_run.id }}

# - name: Get PR number
# id: output_pr_number
# run: |
# export PR_NUMBER=$(cat artifact/pr_number_submit.txt)
# echo "pr-number=$PR_NUMBER" >> $GITHUB_OUTPUT

# staging:
# needs: [generate-uuid, get-pr-number]
# uses: ./.github/workflows/reusable.quickstart_submission.yml
# with:
# pr-number: ${{ needs.get-pr-number.outputs.pr-number }}
# dry-run: false
# secrets:
# nr-api-url: ${{ secrets.NR_API_URL_STAGING }}
# nr-api-token: ${{ secrets.NR_API_TOKEN_STAGING }}
# github-token: ${{ secrets.GITHUB_TOKEN }}
# nr-license-key: ${{ secrets.NEW_RELIC_LICENSE_KEY }}

# production:
# needs: [staging, get-pr-number]
# uses: ./.github/workflows/reusable.quickstart_submission.yml
# with:
# pr-number: ${{ needs.get-pr-number.outputs.pr-number }}
# dry-run: false
# secrets:
# nr-api-url: ${{ secrets.NR_API_URL }}
# nr-api-token: ${{ secrets.NR_API_TOKEN }}
# github-token: ${{ secrets.GITHUB_TOKEN }}
# nr-license-key: ${{ secrets.NEW_RELIC_LICENSE_KEY }}

# eu-production:
# needs: [staging, get-pr-number]
# uses: ./.github/workflows/reusable.quickstart_submission.yml
# with:
# pr-number: ${{ needs.get-pr-number.outputs.pr-number }}
# dry-run: false
# secrets:
# nr-api-url: ${{ secrets.NR_API_URL_EU }}
# nr-api-token: ${{ secrets.NR_API_TOKEN_EU }}
# github-token: ${{ secrets.GITHUB_TOKEN }}
# nr-license-key: ${{ secrets.NEW_RELIC_LICENSE_KEY }}
96 changes: 1 addition & 95 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,100 +10,6 @@ env:
THIRD_PARTY_GIT_AUTHOR_NAME: nr-opensource-bot

jobs:
generate-schema-docs:
name: Generate GraphQL schema documentation
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v3
with:
token: ${{ secrets.OPENSOURCE_BOT_TOKEN }}
ref: "main"
fetch-depth: 0

- name: Setup workspace
uses: './.github/actions/bootstrap'

- name: Generate schema docs for GraphQl
id: generate-schema
env:
NR_API_URL: ${{ secrets.NR_API_URL }}
NR_API_TOKEN: ${{ secrets.NR_API_TOKEN }}
run: cd utils && yarn generate-schema-docs

- name: Commit changes
id: commit-changes
run: |
git config --local user.email "${{ env.THIRD_PARTY_GIT_AUTHOR_EMAIL }}"
git config --local user.name "${{ env.THIRD_PARTY_GIT_AUTHOR_NAME }}"
git add ./docs/*
git diff-index --quiet HEAD ./docs/* || git commit -m 'chore: generate schema documentation [skip ci]'
echo "commit=true" >> $GITHUB_ENV

- name: Temporarily disable branch protections
id: disable-branch-protection
if: always()
uses: actions/github-script@v6
with:
github-token: ${{ secrets.OPENSOURCE_BOT_TOKEN }}
script: |
const result = await github.rest.repos.updateBranchProtection({
owner: context.repo.owner,
repo: context.repo.repo,
branch: 'main',
required_status_checks: null,
restrictions: null,
enforce_admins: null,
required_pull_request_reviews: null
})
console.log("Result:", result)

- name: Push Commit
if: env.commit == 'true'
run: git push origin HEAD

- name: Re-enable branch protections
id: enable-branch-protection
if: always()
uses: actions/github-script@v6
with:
github-token: ${{ secrets.OPENSOURCE_BOT_TOKEN }}
script: |
const result = await github.rest.repos.updateBranchProtection({
owner: context.repo.owner,
repo: context.repo.repo,
branch: 'main',
required_status_checks: {
strict: true,
contexts: [
'Validation / Image count and extension compliance',
'Validation / Ensure icons exist',
'Validation / Install plan ids exist',
'Validation / Data source ids exist',
'Validation / Install plan schema compliance',
'Validation / Data source schema compliance',
'Validation / Quickstart id are unique',
'Validation / Validate Quickstart Schema',
'Validation / Quickstart dashboard name is unique'
]
},
restrictions: {
"users":[],
"teams":[],
"apps":[]
},
enforce_admins: true,
required_pull_request_reviews: {
dismiss_stale_reviews: true,
required_approving_review_count: 1,
dismissal_restrictions: {
users: [],
teams: []
}
}
})
console.log("Result:", result)

generate-third-party-notices:
runs-on: ubuntu-latest
steps:
Expand All @@ -115,7 +21,7 @@ jobs:
fetch-depth: 2

- name: Setup workspace
uses: './.github/actions/bootstrap'
uses: "./.github/actions/bootstrap"

- name: Install OSS CLI
working-directory: ./utils
Expand Down
82 changes: 0 additions & 82 deletions utils/graphql-schemas/constants.js

This file was deleted.

70 changes: 0 additions & 70 deletions utils/graphql-schemas/generate-schema-docs.js

This file was deleted.

Loading
Loading