refactor: Phase 4.3 — unify project field sync workflows into project-field-sync.yml - #2507
Conversation
…-field-sync.yml - Create .github/workflows/project-field-sync.yml with bulk and targeted modes - Migrate auth to GitHub App token (removes PAT dependency) - Add dry_run mode for safe pre-production validation - Delete issue-fields-backfill.yml and issue-project-field-sync.yml - Update sync-issue-fields.cjs with MODE parameter (event/bulk), runEvent and runBulk exports - Add CHANGELOG entry for removed workflows Closes #1408 Co-authored-by: ashleyshaw <1805352+ashleyshaw@users.noreply.github.com>
…-mode warning - Restore weekly schedule trigger (Monday 09:00 UTC) carried over from issue-project-field-sync.yml - Add core.warning when targeted mode is selected with empty issue_filter to surface unintended bulk fallback Co-authored-by: ashleyshaw <1805352+ashleyshaw@users.noreply.github.com>
There was a problem hiding this comment.
🔵 Needs a closer look
The new targeted filter parsing can misclassify labels as issue numbers (breaking targeted runs), and the workflow’s app-token permission set should be aligned with its org-level GraphQL usage to avoid reliability issues.
Pull request overview
This PR consolidates two overlapping project/issue field sync workflows into a single .github/workflows/project-field-sync.yml, standardising on GitHub App authentication and adding a bulk/targeted dispatch interface to reduce duplication and ongoing maintenance.
Changes:
- Replaced the previous field-sync workflows with one unified workflow supporting
bulkandtargetedmodes plus scheduled weekly runs. - Extended
scripts/agents/includes/sync-issue-fields.cjsto dispatch byMODE(event/bulk), with extractedrunEvent()and newrunBulk(). - Added a changelog entry documenting the consolidation and auth standardisation.
File summaries
| File | Description |
|---|---|
.github/workflows/project-field-sync.yml |
New unified workflow covering bulk + targeted sync flows with GitHub App token auth and weekly schedule. |
scripts/agents/includes/sync-issue-fields.cjs |
Adds MODE dispatch and bulk processing, exposing runEvent/runBulk. |
CHANGELOG.md |
Documents the Phase 4.3 consolidation and behavioural changes. |
.github/workflows/issue-project-field-sync.yml |
Deleted in favour of the unified workflow. |
Review details
Suppressed comments (3)
.github/workflows/project-field-sync.yml:110
- The workflow token is restricted to just issues + organisation-projects permissions, but this job also queries organisation-level issue types via GraphQL. If other permissions are dropped when you explicitly set permission-* inputs, the org issue type query will consistently fail and force the less reliable repository fallback. Request the members permission explicitly to match the stated prerequisites and improve reliability.
.github/workflows/project-field-sync.yml:190 - The targeted-mode filter treats any value that contains a leading number as an issue-number list. Labels that begin with digits (e.g. "2026-roadmap") would be misinterpreted and the workflow would try (and fail) to fetch issue #2026 instead of filtering by label.
scripts/agents/includes/sync-issue-fields.cjs:26 - The header comment says the script always writes native_type_* outputs, but in bulk mode it returns an {applied, skipped, errors} object and never writes GITHUB_OUTPUT. Either document that outputs are event-mode only, or emit empty outputs in bulk mode for consistency.
* Outputs (GITHUB_OUTPUT):
* native_type_set - Name of the native type that was applied, or ""
* native_type_id - ID of the type that was applied, or ""
*/
- Files reviewed: 4/4 changed files
- Comments generated: 0
- Review effort level: Lite
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
🔍 Reviewer Summary for PR #2507CI Status: ❌ Recommendations
|
1 similar comment
🔍 Reviewer Summary for PR #2507CI Status: ❌ Recommendations
|
|
🚫 This PR description is missing required template content. Missing required section(s): Global DoD checklist Please update the PR body using one of the repository PR templates:
Empty placeholders, unchecked checklist boxes, and stub issue references do not count. |
Signed-off-by: Ash Shaw <ashley@lightspeedwp.agency>
|
This PR's branch name Standard pattern: Based on linked issue type: Correct template should be: No action required — this is informational. Future PRs should use the correct branch name. See Branching Strategy for more info. |
🔍 Reviewer Summary for PR #2507CI Status: ❌ Recommendations
|
❌ Branch Name Validation FailedThe branch name Required Format
Allowed Branch Types
Valid Examples
Invalid Examples
SolutionRename your branch to follow the pattern and update the PR. For more information, see docs/BRANCHING_STRATEGY.md. |
🔍 Reviewer Summary for PR #2507CI Status: ❌ Recommendations
|
|
@Mergifyio queue |
Merge Queue Status
Waiting for
All conditions
|
🔍 Reviewer Summary for PR #2507CI Status: ❌ Recommendations
|
🔍 Reviewer Summary for PR #2507CI Status: ❌ Recommendations
|
|
✅ PR checklists finalised after merge. |
issue-fields-backfill.yml(bulk, GitHub App auth) andissue-project-field-sync.yml(targeted, PAT auth) shared identical GraphQL logic with inconsistent auth. This consolidates them into a single workflow with consistent GitHub App token auth throughout. Net: −1 workflow.Linked issues
Relates to #1227 (Workflows Consolidation Initiative)
Summary
.github/workflows/project-field-sync.yml(new, replaces both deleted workflows):bulkmode — processes all open issues; equivalent to formerissue-fields-backfill.ymltargetedmode — filters by label name or comma-separated issue numbers viaissue_filterinputissue-project-field-sync.ymldry_runinput across both modescore.warningwhentargetedis selected with an emptyissue_filter(would otherwise silently fall back to bulk)scripts/agents/includes/sync-issue-fields.cjs:run()now dispatches onMODEenv var (event|bulk)runEvent()— extracted single-issue event-driven path (existing behaviour, unchanged)runBulk()— new; paginates all open issues and applies native type syncDeleted:
issue-fields-backfill.yml,issue-project-field-sync.ymlSafety Nets
sync-issue-fields.cjsApproach
run()split intorunEvent/runBulk; workflowscript:block extended with mode-dispatch logicMetrics / Benchmarks (if applicable)
Verification
node --checkpassesRisk & Rollback
Changelog
Changed
scripts/agents/includes/sync-issue-fields.cjs— addedMODEparameter (event|bulk); exposesrunEventandrunBulknamed exportsRemoved
issue-fields-backfill.ymlandissue-project-field-sync.ymlreplaced by unifiedproject-field-sync.ymlwithbulk/targetedmodes, GitHub App token auth throughout, anddry_runsupportChecklist (Global DoD / PR)