Skip to content

fix(ci): find server logs under the testing cache root, never fail on absence - #962

Merged
ErikBjare merged 1 commit into
ActivityWatch:masterfrom
TimeToBuildBob:fix/ci-testing-profile-log-path
Sep 3, 2026
Merged

fix(ci): find server logs under the testing cache root, never fail on absence#962
ErikBjare merged 1 commit into
ActivityWatch:masterfrom
TimeToBuildBob:fix/ci-testing-profile-log-path

Conversation

@TimeToBuildBob

Copy link
Copy Markdown
Contributor

The Test (node-20, py-3.9, aw-server-rust master) matrix leg is failing on every PR right now (e.g. #960, #961). The tests themselves pass — the job dies in the post-test log-collection steps:

cat: '/home/runner/.cache/activitywatch/log/*/*.log': No such file or directory
##[error]Process completed with exit code 1.
mv: cannot stat '/home/runner/.cache/activitywatch/log/*/*.log': No such file or directory
##[error]Process completed with exit code 1.

Root cause

ActivityWatch/aw-server-rust#652 (named instance profiles, merged 2026-08-31) changed get_user_log_dir() from a hardcoded activitywatch root to appname():

-    Ok(dirs::cache_dir().ok_or(())?.join("activitywatch").join("log"))
+    Ok(dirs::cache_dir().ok_or(())?.join(appname()).join("log"))

appname() returns activitywatch-<profile> unless the profile is default, or unless it is testing and legacy testing data already exists on disk. GitHub runners are fresh, so there is no legacy data and aw-server --testing now logs under ~/.cache/activitywatch-testing/.

That explains the exact pass/fail split we see: the master leg runs the nightly (post-#652) binary and fails, while the v0.12.3b18 legs run released pre-#652 binaries and still pass.

Fix

  • Glob ~/.cache/activitywatch*/log/*/*.log so both roots are covered — this restores the diagnostics, which have been silently missing (No files were found with the provided path: logs/dist/*) rather than merely unblocking the job.
  • Guard with nullglob and an explicit empty check so these always()-gated steps exit 0 when there is nothing to collect. A diagnostic step should never gate a merge.

No behavior change when logs are present.

Verification

The glob/nullglob logic was exercised locally for both the empty case (prints a notice, exits 0) and the both-roots case (finds logs under activitywatch/ and activitywatch-testing/). Since this is a pull_request workflow, CI on this PR runs the patched file — the aw-server-rust master leg going green here is the real test.

… absence

The 'aw-server-rust master' matrix leg has failed on every PR since the
aw-server-rust nightly picked up ActivityWatch/aw-server-rust#652 (named
instance profiles, merged 2026-08-31). That change resolves the cache root
via appname(): a --testing server on a machine with no legacy testing data
now logs under ~/.cache/activitywatch-testing/, not ~/.cache/activitywatch/.

GitHub runners are fresh, so the nightly leg writes to the new root while the
pinned v0.12.3b18 legs (pre-ActivityWatch#652 binaries) still use the old one - exactly the
observed pass/fail split.

Glob both roots so the diagnostics come back, and guard with nullglob so these
always()-gated log steps can no longer fail the job when no logs exist. A
diagnostic step should never gate a merge.

Git-Session-Id: f31d
@greptile-apps

greptile-apps Bot commented Sep 2, 2026

Copy link
Copy Markdown
Contributor

Greptile Summary

This PR repairs CI server-log collection after testing-profile logs moved to a profile-specific cache root.

  • Searches both legacy and profile-specific ActivityWatch cache roots.
  • Uses Bash nullglob and explicit empty checks so absent logs do not fail diagnostic steps.
  • Quotes collected paths and the matrix-specific artifact destination.

Confidence Score: 5/5

The PR appears safe to merge, with the previously failing no-log path now handled successfully.

Each matrix leg launches a single ActivityWatch server on a fresh runner, and the revised Bash steps correctly collect its log from either supported cache root or exit successfully when no matching log exists.

Important Files Changed

Filename Overview
.github/workflows/nodejs.yml Broadens server-log discovery to both supported cache roots and safely handles the no-log case without introducing a concrete reachable failure.

Reviews (1): Last reviewed commit: "fix(ci): find server logs under the test..." | Re-trigger Greptile

@codecov

codecov Bot commented Sep 2, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 49.62%. Comparing base (3eebf68) to head (337017b).

Additional details and impacted files
@@           Coverage Diff           @@
##           master     #962   +/-   ##
=======================================
  Coverage   49.62%   49.62%           
=======================================
  Files          46       46           
  Lines        2783     2783           
  Branches      630      630           
=======================================
  Hits         1381     1381           
  Misses       1322     1322           
  Partials       80       80           

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@TimeToBuildBob

Copy link
Copy Markdown
Contributor Author

CI-green and mergeable — waiting only on a maintainer click.

This PR is ready to merge, but the bot has pull-only access to this repo and can't self-merge — surfacing it here so it isn't lost. The monitoring loop will stop re-flagging it now that this note is posted.

@TimeToBuildBob

Copy link
Copy Markdown
Contributor Author

CI green on this PR, including the Test (node-20, py-3.9, aw-server-rust master) leg that was red on every other open PR.

Confirmed the diagnostics are actually restored, not just silenced — the master leg now prints and uploads a real log:

/home/runner/.cache/activitywatch-testing/log/aw-server-rust/aw-server-rust_2026-09-02T23-38-59+0000.log
[2026-09-02 23:38:59][DEBUG][aw_server::config]: Reading config at "/home/runner/.config/activitywatch-testing/aw-server-rust/config.toml"

The logs-aw-server-rust-master artifact is 5597 bytes on this run; previously the step warned No files were found with the provided path: logs/dist/*. Note the path confirms the predicted new root exactly.

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