Skip to content

ci(#11194): introduce CI failure analysis script#11195

Open
dianabarsan wants to merge 12 commits into
masterfrom
11194-add-test-failure-scanner
Open

ci(#11194): introduce CI failure analysis script#11195
dianabarsan wants to merge 12 commits into
masterfrom
11194-add-test-failure-scanner

Conversation

@dianabarsan

@dianabarsan dianabarsan commented Jun 18, 2026

Copy link
Copy Markdown
Member

Description

Claude wrote the script.

#11194

Code review checklist

  • UI/UX backwards compatible: Test it works for the new design (enabled by default). And test it works in the old design, enable can_view_old_navigation permission to see the old design. Test it has appropriate design for RTL languages.
  • Readable: Concise, well named, follows the style guide
  • Documented: Configuration and user documentation on cht-docs
  • Tested: Unit and/or e2e where appropriate
  • Internationalised: All user facing text
  • Backwards compatible: Works with existing data and configuration or includes a migration. Any breaking changes documented in the release notes.
  • AI disclosure: Please disclose use of AI per the guidelines.

Compose URLs

If Build CI hasn't passed, these may 404:

License

The software is provided under AGPL-3.0. Contributions to this project are accepted under the same license.

@dianabarsan dianabarsan changed the title ci: introduce CI failure analysis script ci(#11194): introduce CI failure analysis script Jun 18, 2026
Comment thread scripts/ci/find-test-failures.js Fixed
Introduce a `--job` flag, allowing users to scan specific CI jobs by name or pattern, accelerating test failure analysis by bypassing logs from unrelated suites.
@dianabarsan

Copy link
Copy Markdown
Member Author

@jkuester this is the script I referred to in the call last week. I've been using it locally very successfully. The GH workflow is a WIP but without having it in master, I can't trigger it.

@dianabarsan
dianabarsan requested a review from jkuester June 22, 2026 08:58

@jkuester jkuester left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

LGTM (sorry for the delayed review)! Some minor comments inline, but all in all this is very useful! I tested locally and it works as expected.

I will say that if we want to continue building similar scripts I would prefer it if we had a more structured approach. Dumping everything in a one-off script like this is not easy to maintain. Even the current release-notes script is really annoying and this one is 50% longer. 😓 40+ top-level functions in a single module is a nightmare to read through. At a certain point, my brain shut off and I gave up trying to track the flow through all the levels.... (Also, I think 500 lines is my new JS limit. 😅 Anything more than that should be TS. Trying to keep the mental context of the shape of all the data flowing around here was impossible.)

FWIW, the main goal behind the structuring of https://github.com/jkuester/chtoolbox was that it could be a framework for one-off scripts like this where it takes care of things like cli args, etc while also allowing for re-use of common services (like interacting with GitHub). I have been hesitant pull that into the medic org because there has not been universal buy-in on the Effect framework. 😬 But maybe in the brave new AI world that is less of a problem for folks. 🤷 Alternatively, we could just green-field a new non-Effect repo with similar goals......

Comment thread .github/workflows/find-test-failures.yml
Comment thread scripts/ci/find-test-failures.js Outdated
Comment thread scripts/ci/find-test-failures.js
Comment thread scripts/ci/find-test-failures.js Outdated
Comment thread scripts/ci/find-test-failures.js Outdated
- replace hand-rolled CLI parsing with node:util parseArgs
- hardcode maxBuffer in runGh instead of a never-used option
- move build.yml-coupled job-name constants to the top of the file
- drop unused module exports and the require.main guard

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Comment thread scripts/ci/find-test-failures.js Outdated
Comment thread scripts/ci/find-test-failures.js Outdated
@dianabarsan

Copy link
Copy Markdown
Member Author

I added a temporary trigger (this is needed to be able to run the workout pre-main-merge).
https://github.com/medic/cht-core/actions/runs/30025155113 result visible here.

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