Skip to content

Commit

Permalink
feat: Remove generate-schema-docs scripts and job
Browse files Browse the repository at this point in the history
  • Loading branch information
Andrew Anguiano committed Jun 26, 2024
1 parent 78e8e5e commit 38b2132
Show file tree
Hide file tree
Showing 4 changed files with 1 addition and 248 deletions.
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.

1 change: 0 additions & 1 deletion utils/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@
"generate-uuids": "ts-node generate-uuids.ts",
"sanitize-dashboard": "ts-node sanitize_dashboards.ts",
"dashboard-helper": "ts-node dashboard-helper.ts",
"generate-schema-docs": "ts-node graphql-schemas/generate-schema-docs.js",
"preview": "ts-node preview.ts",
"create-preview-links": "ts-node create-preview-links.ts",
"set-alert-policy-required-datasources": "ts-node set-alert-policy-required-datasources.ts",
Expand Down

0 comments on commit 38b2132

Please sign in to comment.