Skip to content

Add GitHub Actions workflow for PR integration tests against UAA#701

Open
duanemay wants to merge 4 commits into
mainfrom
pull-request-ci
Open

Add GitHub Actions workflow for PR integration tests against UAA#701
duanemay wants to merge 4 commits into
mainfrom
pull-request-ci

Conversation

@duanemay

@duanemay duanemay commented Jul 10, 2026

Copy link
Copy Markdown
Member

Summary

Ports the Concourse uaa-singular-tests job (concourse/pull-requests/pipeline.yml in uaa-ci) to a self-contained GitHub Actions workflow (.github/workflows/pull-request-integration.yml) that runs on every pull request:

  1. Checks out this PR and cloudfoundry/uaa (develop, public repo — no deploy key needed)
  2. Builds UAA's bootWar and boots it, polling /uaa for readiness
  3. Creates the singular-test-client OAuth client via the admin API (same payload the Concourse task and local test/startUAA.sh use)
  4. Installs deps, then installs a chromedriver version matching the runner's Chrome major version at runtime (same pattern the existing Concourse task already uses — never commit a pinned/downgraded version)
  5. Starts the static app server and runs npm test (build + unit + Nightwatch integration)

Differences from the Concourse version, and why:

  • No dependency on the private uaa-ci repo for the shared task script — the logic is inlined directly, since a public-repo pull_request workflow (including fork PRs) shouldn't depend on a private repo.
  • No explicit PR status put steps — GitHub Actions reports the job's pass/fail as the PR check natively.
  • No privileged: true container — nightwatch.json already runs Chrome with --no-sandbox, and GitHub's ubuntu-latest runners ship Chrome preinstalled.
  • Uses pull_request (not pull_request_target): runs with the fork's code and no repo secrets, since none are needed for this job.

Also adds pull_request to unit-test.yml's trigger (alongside the existing push). push-triggered workflows only run in a fork's own Actions context, not upstream, so external contributors' PRs currently get no build/unit-test check at all. Same-repo branches will now run that job twice per commit once a PR is open (push + pull_request) — an accepted, minor cost for a job this cheap.

Test plan

  • Confirm both workflows run successfully on this PR (validates the full UAA build/boot/test flow works in GitHub Actions, and that unit-test now triggers on pull_request)
  • Manually verified the equivalent local flow (build UAA, boot via gradlew, create test client, npm test) succeeds end-to-end

🤖 Generated with Claude Code

Ports the Concourse "uaa-singular-tests" job (concourse/pull-requests/pipeline.yml
in uaa-ci) to a self-contained GitHub Actions workflow that runs on every
pull request: build cloudfoundry/uaa (develop), boot it, create the
singular-test-client OAuth client, then run npm test (build + unit +
Nightwatch integration) against it.

The Concourse version depends on the private uaa-ci repo for its shared
task script and on the github-pr-resource for status reporting; neither
is needed here — GitHub Actions reports pass/fail natively, so the task
logic is inlined directly into the workflow. Chromedriver is installed
at runtime to match the runner's Chrome major version, same pattern the
existing Concourse task already uses.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Copilot AI review requested due to automatic review settings July 10, 2026 22:29

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Adds a self-contained GitHub Actions workflow to run the existing UAA + Singular end-to-end integration flow on every PR, replacing the need for the Concourse uaa-singular-tests job for PR validation.

Changes:

  • Introduces a pull_request workflow that checks out this repo and cloudfoundry/uaa (develop), builds UAA, boots it, and waits for readiness.
  • Creates the singular-test-client via UAA’s admin API, then installs Node deps + a Chrome-major-matched chromedriver.
  • Starts the local static server and runs npm test (build + unit + Nightwatch integration).

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread .github/workflows/pull-request-integration.yml Outdated
Comment thread .github/workflows/pull-request-integration.yml
Comment thread .github/workflows/pull-request-integration.yml
Comment on lines +16 to +19
with:
repository: cloudfoundry/uaa
ref: develop
path: uaa
Comment thread .github/workflows/pull-request-integration.yml Outdated
duanemay and others added 3 commits July 10, 2026 18:32
push-triggered workflows only run in a fork's own Actions context, not
upstream, so external contributors' PRs (the normal case for this
open-source repo) currently get no build/unit-test check at all.
Adding pull_request coverage means every PR gets that fast feedback,
alongside the new integration workflow.

Same-repo branches will now run the job twice per commit once a PR is
open (push + pull_request) — an accepted, minor cost for a job this
cheap.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
- Add explicit contents: read permissions and persist-credentials:
  false on both checkouts, since this runs on pull_request (including
  forks) and doesn't need write access.
- Use npm ci for a deterministic install, and --no-save when
  installing the Chrome-matched chromedriver so it doesn't mutate
  package-lock.json during the run.
- Glob for the built WAR instead of hardcoding its filename, as cheap
  insurance against UAA's build ever changing its version string
  (verified it's currently fixed at 0.0.0, so this wasn't an active
  bug, but the previous run confirmed the working-directory/path
  itself was already correct).

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
- unit-test.yml: scope push/pull_request to main (avoids redundant
  runs on every feature-branch commit before/after a PR opens), and
  bump actions/checkout from v1 to v4.
- pull-request-integration.yml: same push/pull_request scoping, plus a
  daily schedule (07:30 UTC) so drift in cloudfoundry/uaa's develop
  branch is caught even without an open PR.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Development

Successfully merging this pull request may close these issues.

2 participants