Skip to content

Use test-actions as the standard place to test the automations #98

Description

@akolson

Overview

Testing a change to the automations, or to the sync workflow, currently means setting up a separate
GitHub organization with its own app, secrets, and Google service account.

learningequality/test-actions already has all of that except two secrets. Make it the standard
place to test, and a developer needs no setup at all.

Complexity: Low
Target branch: main

Context

The automations run in a consumer repo and need the bot app and the secrets. test-actions has
both.

Several of them also gate on is-contributor, so they only run for an author outside the
organization. Triggering those needs a second GitHub account that is not a member, which needs no
permissions, secrets or app of its own.

The sync workflow walks the whole organization and writes to what it finds. Containment today comes
from a token scoped to repos the developer owns, which is the reason a separate organization is
needed at all.

The Change

Narrow a sync run to one repo. Add --only <repo> to scripts/sync-automation-template.js,
exposed as an only input on the workflow. A developer dispatches with only: test-actions and it
runs as the real app against one repo, so containment is an input rather than a credential they
have to build.

Make test-actions a real consumer. Remove the three callers pointing at
MisRob/.github@community-automations-updates, which belong to the process #97 replaced, and add an
unedited copy of automation-template.yml at .github/workflows/automation.yml.

Point the spreadsheet at a test sheet. Create a Google Sheet, share it with the production
service account's client_email as an editor, and set CONTRIBUTIONS_SPREADSHEET_ID and
CONTRIBUTIONS_SHEET_NAME as repository secrets on test-actions. Repository secrets take
precedence over organization ones, so no new service account is needed.

They stay unset by default rather than inheriting production, because an unset id fails loudly while
a production id would quietly write test rows into the real sheet.

Document it. Add docs/testing-automations.md and link it from docs/automation.md. Put the
setup steps for a separate organization in docs/testing-in-a-separate-org.md, so the page a
developer reads first stays short.

Out of Scope

  • Changing what any automation does.
  • Changing the separate sandbox organization. It stays the only way to test against a
    non-production app, and its setup is documented rather than altered.

Acceptance Criteria

  • --only <repo> narrows discovery to that repo, with a test, and the workflow exposes it.
  • The three MisRob callers are gone and test-actions holds an unedited copy of the template.
  • A test sheet is shared with the production service account, and the two ids are set as
    repository secrets on test-actions.
  • Opening a pull request in test-actions runs the automations with no failed step. The ones
    gated on is-contributor skip for an org member, so a second account outside the
    organization is needed to exercise those.
  • docs/testing-automations.md covers both flows and notes that a branch-pinned caller at the
    discovered path is proposed against on every run, so experimental ones belong elsewhere.
  • docs/testing-in-a-separate-org.md holds the setup steps for that route, and says when it is
    worth the effort.

Testing

  1. Dispatch with only: test-actions and dry_run. Expect one row and no other repo.
  2. Drift the copy, dispatch with only: test-actions. Expect one pull request, and none elsewhere.
  3. Open a pull request in test-actions from an account outside the organization. Expect the
    contributor reply, and the row in the test sheet. Opening it as a member instead skips both,
    because is-contributor is false.
  4. Dispatch without only. Expect every consumer, including test-actions.

References

AI usage

I used Claude Code to check what test-actions already provides and to draft this issue. I decided
the approach, and verified the secret visibility and existing callers against the repo.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

documentationImprovements or additions to documentationgithub_actionsPull requests that update GitHub Actions code

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions