Skip to content

improve local act workflow UX#13

Merged
mt4110 merged 3 commits intomainfrom
feat/add_act
Apr 5, 2026
Merged

improve local act workflow UX#13
mt4110 merged 3 commits intomainfrom
feat/add_act

Conversation

@mt4110
Copy link
Copy Markdown
Owner

@mt4110 mt4110 commented Apr 5, 2026

What changed

  • added ci-self act workflow discovery, interactive workflow selection, timestamped streaming logs, benchmark timestamps, and job validation with helpful hints
  • updated scaffolded verify.yml templates and this repo's own verify workflow so actions/checkout still runs under act
  • added TTY confirmations before creating or overwriting verify.yml
  • documented the local act flow in the README and quickstart guides

Why

  • local act runs were too easy to misuse across different repositories because workflow selection and job selection could be confused
  • skipping checkout under ACT turned out to be the wrong model for real repo validation
  • creating or overwriting verify.yml needed a safer interactive confirmation path

Impact

  • ci-self act is now usable across repositories with clearer workflow/job guidance and better logs
  • generated verify workflows are more likely to work correctly under act
  • users get a safer prompt before verify.yml is created or overwritten from a TTY

Validation

  • env GOCACHE=/tmp/ci-self-go-cache GOTMPDIR=/tmp/ci-self-go-tmp mise x -- go test ./ops/ci
  • bash ops/ci/ci_self.sh act --workflow .github/workflows/verify.yml --job verify-lite
  • bash ops/ci/ci_self.sh act --project-dir /Users/takemuramasaki/dev/maakie-brainlab --workflow .github/workflows/verify.yml --job verify

Copilot AI review requested due to automatic review settings April 5, 2026 14:56
Copy link
Copy Markdown
Owner Author

mt4110 commented Apr 5, 2026

AI review result: no blocking findings.

Checked areas:

  • ci-self act workflow discovery, job resolution, and timestamped logging flow
  • verify.yml scaffolding and ACT compatibility adjustments
  • README / quickstart guidance around workflow selection vs --job
  • tests covering interactive selection, invalid job hints, numeric job resolution, and scaffold confirmations

Validation used:

  • env GOCACHE=/tmp/ci-self-go-cache GOTMPDIR=/tmp/ci-self-go-tmp mise x -- go test ./ops/ci
  • bash ops/ci/ci_self.sh act --workflow .github/workflows/verify.yml --job verify-lite
  • bash ops/ci/ci_self.sh act --project-dir /Users/takemuramasaki/dev/maakie-brainlab --workflow .github/workflows/verify.yml --job verify

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR improves the local act-based workflow in ci-self to make targeted local verify runs easier/safer (workflow discovery + selection, clearer logs/timing, and safer verify workflow scaffolding), and updates the repository/docs so generated and in-repo verify workflows behave correctly under act.

Changes:

  • Added ci-self act command with workflow discovery/interactive selection, job validation hints, and timestamped streaming logs + benchmark timestamps.
  • Updated verify workflow templates and this repo’s .github/workflows/verify.yml to run actions/checkout under act, and to avoid GHA-only steps (Discord/artifact upload) during act runs.
  • Added TTY confirmation prompts before creating/overwriting verify.yml, plus documentation updates (JP/EN + guides).

Reviewed changes

Copilot reviewed 9 out of 9 changed files in this pull request and generated 4 comments.

Show a summary per file
File Description
README.md Documents the local ci-self act flow and caveats (JP).
README_EN.md Documents the local ci-self act flow and caveats (EN).
ops/ci/scaffold_verify_workflow.sh Adds TTY confirmations + updates templates for act compatibility (checkout + act bypass + Go setup behavior).
ops/ci/scaffold_verify_workflow_test.go Adds coverage for create/skip/prompt behaviors in the scaffold script.
ops/ci/ci_self.sh Implements ci-self act (workflow discovery/selection, job listing/validation, timestamped logs, timing).
ops/ci/ci_self_test.go Adds tests for act UX/behavior (help, missing act, selection, invocation building, job hints).
docs/ci/QUICKSTART.md Adds quickstart section for local targeted timing via ci-self act.
docs/ci/FLOW.md Updates recommended flow to include ci-self act for local timing.
.github/workflows/verify.yml Makes verify jobs runnable under act and avoids GHA-only integrations during act.

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

Copy link
Copy Markdown

@chatgpt-codex-connector chatgpt-codex-connector bot left a comment

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 4c405f4242

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 9 out of 9 changed files in this pull request and generated 3 comments.


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

@mt4110 mt4110 requested a review from Copilot April 5, 2026 15:50
@mt4110 mt4110 changed the title [codex] improve local act workflow UX improve local act workflow UX Apr 5, 2026
@mt4110 mt4110 merged commit 3834592 into main Apr 5, 2026
4 checks passed
@mt4110 mt4110 deleted the feat/add_act branch April 5, 2026 15:51
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 9 out of 9 changed files in this pull request and generated 3 comments.

Comments suppressed due to low confidence (2)

ops/ci/scaffold_verify_workflow.sh:216

  • The scaffolded nix workflow template uses a floating action tag (actions/checkout@v4). If the project policy is to pin actions to SHAs (as in .github/workflows/verify.yml), consider pinning this checkout step too.
      - self-hosted
      - mac-mini
    timeout-minutes: 45
    steps:
      - uses: actions/checkout@v4

      - name: Verify (Nix)

ops/ci/scaffold_verify_workflow.sh:266

  • The scaffolded minimal workflow template uses a floating action tag (actions/checkout@v4). If the project policy is to pin actions to SHAs (as in .github/workflows/verify.yml), consider pinning this checkout step too.
      - self-hosted
      - mac-mini
    timeout-minutes: 20
    steps:
      - uses: actions/checkout@v4


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

Comment on lines +440 to +451
while true; do
printf '> どのworkflowを、actで実行したいですか?\n' >&2
idx=1
for workflow in "${workflows[@]}"; do
printf '> [%d] %s\n' "$idx" "$(workflow_menu_label "$project_dir" "$workflow")" >&2
idx=$((idx + 1))
done
printf '> [q] quit\n' >&2
printf '> ' >&2
if ! IFS= read -r choice; then
printf '\n' >&2
log_ts_err "SKIP: act selection cancelled"
Copy link

Copilot AI Apr 5, 2026

Choose a reason for hiding this comment

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

select_local_workflow always prompts when multiple workflows exist. In non-interactive contexts (stdin/stdout not a TTY), this can block waiting for input; it would be safer to detect non-interactive mode and fail fast with a clear error telling the user to pass --workflow (and optionally --list to inspect).

Copilot uses AI. Check for mistakes.
Comment on lines +72 to +75
local line=""
while IFS= read -r line || [[ -n "$line" ]]; do
printf '[%s] %s\n' "$(timestamp_now)" "$line"
done
Copy link

Copilot AI Apr 5, 2026

Choose a reason for hiding this comment

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

prefix_stream_with_timestamp runs date once per log line, which can become a noticeable CPU bottleneck for verbose act runs. Consider using a single process (e.g., awk with strftime()), or caching the timestamp at 1-second resolution, to reduce per-line process spawning overhead while keeping the same output format.

Suggested change
local line=""
while IFS= read -r line || [[ -n "$line" ]]; do
printf '[%s] %s\n' "$(timestamp_now)" "$line"
done
awk '{
printf "[%s] %s\n", strftime("%Y %m/%d %H:%M:%S"), $0
fflush()
}'

Copilot uses AI. Check for mistakes.
Comment on lines 150 to 154
- uses: actions/checkout@v4

- name: Setup Go
if: ${{ !env.ACT }}
uses: actions/setup-go@v5
Copy link

Copilot AI Apr 5, 2026

Choose a reason for hiding this comment

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

The scaffolded workflow template uses floating action tags (actions/checkout@v4, actions/setup-go@v5). This repo’s own workflow pins actions to commit SHAs, which is safer against supply-chain changes; consider pinning the scaffolded actions as well (and updating them periodically).

Suggested change
- uses: actions/checkout@v4
- name: Setup Go
if: ${{ !env.ACT }}
uses: actions/setup-go@v5
- uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332
- name: Setup Go
if: ${{ !env.ACT }}
uses: actions/setup-go@cdcb36043654635271a6c05b4a6f81a27334f679

Copilot uses AI. Check for mistakes.
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.

2 participants