Skip to content

Improve handling of action results ZIP archives generated by the new service #10868

Open

Description

@babakks

Problem

It's not clear why/when action results log ZIP archives are served from different sources. Unfortunately, as noticed in #10853, the structures are slightly different but still big enough to render GH CLI unable to detect the right content. I'm following up on this internally with the Actions team to see if we can fix this with a more reliable solution.

In the meantime, we should improve GH CLI to capture both structures.

To recap, below are two sample cases served by different services. Note that the underscores in question appear in both top-level and nested .txt files in the ZIP archive.

gh run -R single-cell-data/TileDB-SOMA view --log -j 41013280987 # new service (with underscores)
gh run -R    ryan-williams/TileDB-SOMA view --log -j 41020345782 # old service (no underscores)
Old service ZIP structure
$ unzip -l run-log-14620886373-1745418926.zip
Archive:  run-log-14620886373-1745418926.zip
  Length      Date    Time    Name
---------  ---------- -----   ----
     8607  2025-04-25 12:38   build (macos-latest, 3.11)  build/12_Log pip dependencies.txt
      326  2025-04-25 12:38   build (macos-latest, 3.10)  build/5_Select XCode version.txt
   678045  2025-04-25 12:38   build (ubuntu-24.04, 3.13)  build/7_Set Up Test Data.txt
      992  2025-04-25 12:38   -2147434496_build.txt
   972023  2025-04-25 12:38   build (macos-latest, 3.13)  build/14_Run pytests for Python.txt
      648  2025-04-25 12:38   build (ubuntu-24.04, 3.11)  build/29_Post Set up Python 3.11.txt
    17777  2025-04-25 12:38   build (macos-latest, 3.12)  build/13_Run libtiledbsoma unit tests.txt
      484  2025-04-25 12:38   build (ubuntu-24.04, 3.9)  build/29_Post Set up Python 3.9.txt
      292  2025-04-25 12:38   build (macos-latest, 3.9)  build/2_Show matrix OS.txt
     1463  2025-04-25 12:38   build (macos-latest, 3.13)  build/4_MacOS CPU info.txt
        0  2025-04-25 12:38   build (ubuntu-24.04, 3.9)  build/
  2193670  2025-04-25 12:38   0_build (ubuntu-24.04, 3.9)  build.txt
...
New service ZIP structure
$ unzip -l run-log-14618823537-1745413328.zip 
Archive:  run-log-14618823537-1745413328.zip
  Length      Date    Time    Name
---------  ---------- -----   ----
  2115907  1980-00-00 00:00   7_build (ubuntu-24.04, 3.13) _ build.txt
      804  1980-00-00 00:00   build (ubuntu-24.04, 3.13) _ build/system.txt
  1934162  1980-00-00 00:00   8_build (macos-latest, 3.12) _ build.txt
      804  1980-00-00 00:00   build (macos-latest, 3.12) _ build/system.txt
  2178955  1980-00-00 00:00   9_build (ubuntu-24.04, 3.9) _ build.txt
      804  1980-00-00 00:00   build (ubuntu-24.04, 3.9) _ build/system.txt
  1993470  1980-00-00 00:00   10_build (macos-latest, 3.13) _ build.txt
      804  1980-00-00 00:00   build (macos-latest, 3.13) _ build/system.txt
    24094  1980-00-00 00:00   12_build (ubuntu-24.04, 3.11) _ lint.txt
...

Acceptance Criteria

Given I have a actions results log served by the old service
when I gh run view --log <run-id>
then The logs are shown

Given I have a actions results log served by the new service
when I gh run view --log <run-id>
then The logs are shown

Given I am running against a GHES remote
when I run gh run view --log <run-id>
then The logs (that will come back in the old format) are shown

Activity

  1. added
    gh-run
    bug
    priority-2
    core
    on Apr 25, 2025
  2. andykingit commented on May 30, 2025

    @andykingit

    Any plans to work on this issue? A month later it's still a problem.

  3. babakks commented on Jun 2, 2025

    @babakks
    MemberAuthor

    Thanks for the nudge, @andykingit! 🙏 This issue has been discussed in the team and it's under our radar to bring it into our planning after we're done with some other stuff. Also, since this is a bit of integration issue, we're following up with the other stakeholders. I cannot give you an estimate here, though.

  4. babakks commented on Jun 27, 2025

    @babakks
    MemberAuthor

    @ryan-williams, @kperkins-godaddy, @andykingit, @richmondjerry, @dlvhdr, @ptorgalmath-gpsw we're implementing a fallback approach (stated in #11118 and #11169, and implemented in #11172) for when gh couldn't find the logs in the downloaded ZIP archive. It's not a replacement for this issue, of course, but will fix the use cases. You're welcome to build gh from the PR's branch and test it on your end.

  5. dlvhdr commented on Jun 28, 2025

    @dlvhdr

    Hey @babakks, I just confirmed, PR #11172 works great! I can fetch all jobs' logs.

  6. thinkmorepawan commented on Oct 30, 2026

    @thinkmorepawan

    Still reproducible on gh version 2.103.3 (2026-10-26).

    Since the API fallback (#11172), logs are now printed, but for any reusable-workflow job (named <caller> / <callee>) every line is labelled UNKNOWN STEP, because the step files in the ZIP are never matched.

    Example: job deploy / scan (env: prod) is stored in the ZIP as deploy _ scan (env prod)/5_<step name>.txt, but getJobNameForLogFilename in pkg/cmd/run/view/logs.go deletes the / and searches for deploy scan (env prod) (double space), so neither the job file nor any step file matches.

    Replacing / with _ instead of deleting it (in getJobNameForLogFilename) matches the step files in the ZIP for our runs, so --log-failed would show real step names again.

  7. rplanasHavDev commented on Oct 30, 2026

    @rplanasHavDev

    Another data point, from a private repository, so no runs I can link. This one has no / in the job name, and the output is partial rather than empty.

    gh version 2.103.2 (2026-10-23) on Linux. Two pull_request runs of the same workflow in the same repository, both attempt 1, an hour apart, each with one job named Build, typecheck, test (npm):

    • Run 1. The archive from GET /repos/{owner}/{repo}/actions/runs/{id}/logs holds only Build, typecheck, test (npm)/system.txt and the top-level 0_Build, typecheck, test (npm).txt (242,885 bytes). gh run view <id> --log prints the whole job, 1601 lines.
    • Run 2. The archive holds the same top-level 0_…txt (242,978 bytes) plus per-step files: 1_Set up job.txt, 2_Run [email protected], 3_Run [email protected], 4_Run npm ci.txt, 5_Run npm run build.txt, 6_Run npm run typecheck.txt, 7_…, 8_…, 9_…, 10_Run npm test.txt (221,105 bytes), then 18_… to 21_Complete job.txt. The jobs API lists steps 1–10 and 18–21, all success. gh run view <id> --log prints 89 lines covering steps 1, 3, 4 and 5 only, and exits 0. Step 2 is dropped, and so is everything from step 6 on, the 221 KB step 10 included. Re-running the command gives the same output.

    GET /repos/{owner}/{repo}/actions/jobs/{job_id}/logs returns the complete log for run 2's job. Through gh api that needs --allow-escape-sequences, because the log contains ANSI colour codes.

    So the per-step layout is not all-or-nothing: some step files are matched and others silently skipped, while the exit status stays 0. For tooling that parses --log output (we read test counts from it), that is worse than an empty result, since nothing signals that the log is incomplete. In both layouts the top-level 0_<job>.txt held the full log, which may be the more reliable source when it is present.

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

    bugcoregh-runpriority-2

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions