Skip to content

Phase 3: Pre-deploy workflows at repo creation; stop re-deploying on publish #407

Closed

Description

@neuromechanist

Parent: #406

Problem

backend/src/routes/admin.ts:2701-2730 (publish step ci_check) calls deployWorkflows() defensively on every publication. Inside, deployWorkflows() (backend/src/services/github.ts:1234) loops over each workflow template and calls createOrUpdateFile() (2 REST calls each). For N templates that is 2N redundant REST calls per publish.

Workflows are static; they only need redeployment when the template content changes.

Proposal

  1. Pre-deploy at repo creation. createRepository() flow already has a PAT; immediately follow with a batched-tree commit (Phase 1) that lays down all workflow templates plus an initial dataset_description.json skeleton. One commit, one tree call.
  2. Migration step. Add nemar admin ci sync-templates [--all] that diffs every dataset repo's deployed workflow contents against the current getWorkflowTemplates() output and only updates ones that differ. Run on demand, not on every publish.
  3. Remove defensive redeploy from ci_check. Replace with a cheap HEAD /repos/{org}/{repo}/contents/.github/workflows/bids-validation.yml to confirm presence; only redeploy if missing.

Acceptance

  • Workflow templates land at repo creation in a single tree commit.
  • ci_check step does not call deployWorkflows() unless the workflow file is missing.
  • nemar admin ci sync-templates exists and only writes diffs.
  • Publish flow REST-call count for ci_check drops to <= 2 in the steady state.

Activity

  1. added
    P2
    refactor
    backend
    on May 10, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    P2backendrefactor

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions