Extend “info:report” Job to Emit JSON Status Report on GitLab Pages
We need to enhance the existing info:report CI job so that, in addition to printing a human-readable summary, it emits a machine-readable JSON file (status.json) and publishes it via GitLab Pages. This will allow other tools or badges (via Shields.io) to consume the report automatically.
Objectives
- Modify the
info:reportjob (templates/info.yml) to generate a JSON file reflecting each test’s status. - Copy the JSON into the
public/directory so it is published on the Pages site. - Ensure the JSON schema follows Shields.io endpoint format for easy badge integration.
Proposed Implementation
-
Update
bin/final_report.sh- After collecting each job status, assemble a JSON object:
{ "schemaVersion": 1, "pipelineId": 1234, "updatedAt": "2025-07-13T12:34:56Z", "label": "GitLab status", "message": "OK|x failed", # x = number of test failed "color": "green|red", # OK = green, red = failed "results": { "api": "success", "pages": "failed", … }, } - Write this JSON to
public/status.json.
- After collecting each job status, assemble a JSON object:
-
Adjust
templates/info.yml- In the
info:reportjob’s script:- Run
bin/final_report.shto generate both console output andpublic/status.json.
- Run
- Declare
publicas anartifacts:paths:so that GitLab Pages picks it up:artifacts: paths: - public expire_in: 1 week
- In the
-
Expose via GitLab Pages
- Ensure
.gitlab-ci.ymlincludes the Pages job (templates/pages.yml) so thatpublic/status.jsonis deployed. - Confirm that visiting
https://<NAMESPACE>.gitlab.io/<PROJECT>/status.jsonreturns the file.
- Ensure
-
Badge Integration (example)
- Consumers can add:
[]()
- Consumers can add:
References
- Shields.io JSON endpoint: https://shields.io/endpoint
- GitLab Pages artifacts: https://docs.gitlab.com/ee/user/project/pages/
- CI artifacts: https://docs.gitlab.com/ee/ci/yaml/#artifacts
Acceptance Criteria
-
bin/final_report.shwrites a validpublic/status.jsonfile. -
info:reportjob artifacts includepublic/status.json. -
GitLab Pages publishes the JSON at a stable URL. -
Sample Shields.io badge in README correctly reflects pipeline health. -
Documentation ( docs/setup-fr.md&docs/setup.md) updated with instructions.
Edited by Placeholder Christophe Chaudier