fix(automation): rebuild NerdGraph API detector workflow - #1422
Open
pranav-new-relic wants to merge 3 commits into
Open
fix(automation): rebuild NerdGraph API detector workflow#1422pranav-new-relic wants to merge 3 commits into
pranav-new-relic wants to merge 3 commits into
Conversation
The scheduled `graphql-schema.yml` workflow has been failing since the `feat/automated-codegen` branch it referenced was deleted, and a silent typo (`heroHention`) was preventing the code-generation job from running even when the diff turned up new APIs. Replace the file with a renamed pair so the new flow appears as a fresh workflow in the Actions UI: - `nerdgraph-api-detector.yml` does the actual schema diff and Slack reporting, and now references `generate.yml@main`. The typo is fixed. Trigger is `workflow_dispatch`-only. - `nerdgraph-api-detector-scheduler.yml` owns the cron and dispatches the detector via `gh workflow run` using `secrets.DEV_TOOLKIT_TOKEN`. Because `workflow_dispatch` runs are attributed to the dispatching token's owner, scheduled runs now show as `nr-developer-toolkit` instead of whichever human last touched the workflow file. Step names and inline comments were reworked to make the pipeline self-explanatory for newcomers.
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #1422 +/- ##
==========================================
+ Coverage 32.29% 33.43% +1.14%
==========================================
Files 146 148 +2
Lines 6766 6909 +143
==========================================
+ Hits 2185 2310 +125
- Misses 4375 4384 +9
- Partials 206 215 +9
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
Drop the emoji-heavy step names introduced in the previous commit and use neutral, descriptive titles consistent with the rest of the repo's workflows. Comments are kept (still useful for newcomers) but rewritten in a more conventional tone.
The detector's responsibility is now strictly to report what changed in NerdGraph since the previous run. Drop the `generate-go-bindings` job and the four job outputs (heroMention/tutoneConfig/newMutations/packages) that existed only to feed it. The reusable `.github/workflows/generate.yml` is left in place since it is invoked from elsewhere; only the call site is removed here.
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Summary
The scheduled
graphql-schema.ymlworkflow has been failing for some time and (silently) skipping its code-generation job. This PR replaces it with a renamed, refreshed pair of workflows that fix all three issues at once and run under the bot's identity going forward.What was broken
generate.yml@feat/automated-codegengraphql-schema.yml:165heroHentioninstead ofheroMentiongraphql-schema.yml:163generate-codejob has been silently skipped on every run because the condition compared a non-existent output to''.sanderblue), not the botschedule:triggerscheduleevents is hard-set by GitHub; no YAML config can override it.What this PR does
graphql-schema.yml→nerdgraph-api-detector.ymland creates a siblingnerdgraph-api-detector-scheduler.yml. The new file paths give us a fresh workflow entry in the Actions UI (clean run history).generate.yml@feat/automated-codegen→generate.yml@main.heroHention→heroMention.nerdgraph-api-detector-scheduler.yml, whose only job isgh workflow run nerdgraph-api-detector.ymlusingsecrets.DEV_TOOLKIT_TOKEN. Becauseworkflow_dispatchruns are attributed to the dispatching token's owner, the actual schema-diff work always shows up undernr-developer-toolkit— the same pattern that makes the release workflow's changelog commits attributed to the bot.Why two files instead of one
For
scheduletriggers GitHub forces the run actor to "the user that last pushed the workflow file." The only reliable way to attribute scheduled runs to the bot is to keep the cron in a tiny dispatcher whose only job is an authenticated API call to dispatch the real workflow. The release workflow gets bot attribution for free because it'sworkflow_dispatch-only — we apply the same pattern here.Prereqs
secrets.DEV_TOOLKIT_TOKENalready exists in the repo (used bygenerate.ymlforpeter-evans/create-pull-request). It needsactions: writeon this repo to dispatch workflows; if it can already create PRs, it almost certainly can dispatch.Test plan
🔍 NerdGraph API Detectorvia "Run workflow" once to confirm it parses and the schema diff path still works.nr-developer-toolkit.🛠️ Generate Go bindings for new APIsjob actually runs andgenerate.ymlopens the expected draft PR.🤖 Generated with Claude Code