Skip to content

Redesign Github workflows#59

Open
FooBarWidget wants to merge 6 commits into
mainfrom
pr_ci
Open

Redesign Github workflows#59
FooBarWidget wants to merge 6 commits into
mainfrom
pr_ci

Conversation

@FooBarWidget
Copy link
Copy Markdown
Member

@FooBarWidget FooBarWidget commented May 13, 2026

  • Have a single test-and-build workflow for testing everything as well as building the API server. Get rid of the separate "build API server" workflow.
  • Have the deploy workflow trigger based on successful completion of API server build on the main branch.
  • Syntax check Ansible.
  • Security audit workflows using zizmor — thanks TanStack for the tip.
  • Make test-and-build workflow compatible with pull requests.
  • Enforce timeouts.

- Have a single test workflow for testing everything, including the API server.
- Split the API server workflow into a build part and a deploy part. Get rid of test steps, since that's done by the test workflow.
- Syntax check Ansible.
- Make test and API server build workflows compatible with pull requests.
- Enforce timeouts.
@FooBarWidget FooBarWidget requested review from abtreece and rus-max May 13, 2026 16:01
@github-advanced-security
Copy link
Copy Markdown

You are seeing this message because GitHub Code Scanning has recently been set up for this repository, or this pull request contains the workflow file for the Code Scanning tool.

What Enabling Code Scanning Means:

  • The 'Security' tab will display more code scanning analysis results (e.g., for the default branch).
  • Depending on your configuration and choice of analysis tool, future pull requests will be annotated with code scanning analysis results.
  • You will be able to see the analysis results for the pull request's branch on this overview once the scans have completed and the checks have passed.

For more information about GitHub Code Scanning, check out the documentation.

Copy link
Copy Markdown
Collaborator

@abtreece abtreece left a comment

Choose a reason for hiding this comment

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

Solid consolidation — security posture is meaningfully better than what it replaces. A few inline notes.

elif [[ "$GITHUB_EVENT_NAME" == "push" ]]; then
before_sha="$GITHUB_EVENT_BEFORE"
head_sha="$GITHUB_SHA"
if [[ "$before_sha" =~ ^0+$ ]] || ! git cat-file -e "$before_sha" 2>/dev/null; then
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Could silently skip the build on force-push: git diff-tree -r "$head_sha" only sees the tip commit, so apiserver/ changes in any non-tip commit get missed. Consider failing open (changed=true) when before_sha is invalid — over-building is cheaper than missing a deploy.

- name: Check that we're using system Ruby
run: test "$(which ruby)" = /usr/bin/ruby

- uses: actions/cache@27d5ce7f107fe9357f9df03efb73ab90386fccae # v5.0.5
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Worth adding restore-keys so a Gemfile.lock bump doesn't blow the whole cache:

restore-keys: |
  ${{ runner.os }}-24.04-${{ runner.arch }}-gems-

Comment thread .github/workflows/test-and-build.yml
echo "Build SHA: $BUILD_HEAD_SHA"
} > tag-message.txt

git tag -f -a apiserver-"$GITHUB_RUN_NUMBER" -F tag-message.txt "$BUILD_HEAD_SHA"
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

GITHUB_RUN_NUMBER is stable across re-runs, so a re-run of an already-published deploy will fail at git push origin apiserver-N (remote tag exists). Probably fine as a guardrail — but -f here rewrites the local tag before the push fails, so local and remote drift. Dropping -f would surface the conflict earlier.

Comment thread apiserver/README.md
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants