Skip to content

ci: Add script for fetching past test stats from CI #7086

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 7 commits into from
Apr 12, 2023

Conversation

mafredri
Copy link
Member

@mafredri mafredri commented Apr 11, 2023

Basic script that fetches stats (Print test stats) from CI, useful for local analysis or pulling historical stats.

This produces JSON files with PR/merge metadata and stats:

{
  "event": "pull_request",
  "branch": "rmauditflag",
  "sha": "c3c08cdda018f849c94af817a63e23e450eb80f2",
  "started_at": "2023-04-04T16:56:01Z",
  "completed_at": "2023-04-04T16:56:10Z",
  "display_title": "fix: remove audit-logging flag from the server",
  "url": "https://github.com/coder/coder/actions/runs/4610309581/jobs/8148624415",
  "stats": {
    "packages": [
      {
        "name": "agent",
        "time": 18.364
      },
...

Refs: #6677, #6675

@mafredri mafredri self-assigned this Apr 11, 2023
@mafredri mafredri force-pushed the mafredri/ci-stats-fetch-script branch from e40ec5f to d873a70 Compare April 11, 2023 14:58
@mafredri mafredri requested a review from mtojek April 11, 2023 15:00
Copy link
Member

@mtojek mtojek left a comment

Choose a reason for hiding this comment

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

Could you please link it with the Github issue?

Anyway, code LGTM 👍 I know that you love using shell scripts :)


# Usage: ./fetch_stats_from_ci.sh
#
# This script is for fetching historic test stats from GitHub Actions CI.
Copy link
Member

Choose a reason for hiding this comment

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

What is the next step for this script? I'm wondering if we can keep it as a Github Action. The result can be downloaded as workflow artifact.

Copy link
Member Author

Choose a reason for hiding this comment

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

This script will hopefully not be needed much, it's main purpose is to populate the historical data since #6676. The main mechanism through which the gathering of stats will happen is via webhook.

It can still be useful in the future if someone wants to do some local analysis.

@mafredri mafredri enabled auto-merge (squash) April 12, 2023 09:38
@mafredri mafredri merged commit 770712e into main Apr 12, 2023
@mafredri mafredri deleted the mafredri/ci-stats-fetch-script branch April 12, 2023 10:03
@github-actions github-actions bot locked and limited conversation to collaborators Apr 12, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants