Skip to content
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

report: add workflow and documentation #448

Open
wants to merge 4 commits into
base: main
Choose a base branch
from

Conversation

klaskosk
Copy link
Collaborator

Depends-on: #447

The final PR in the series adding the initial version of the report program, this PR adds the GitHub workflow and documentation for the report program. Once merged, all pushes will update the report using the latest version of the program and templates.


This is PR 4/4. An example report can be seen on my GitHub pages.

To break up the eco-gotests reporter into managable PRs, I have started with the templates for the report as a whole and the individual trees (branches).

report_template.html is the entrypoint for viewing the reports and simply contains a list of the branches in the report along with links to the latest commit on each branch.

tree_template.html is the report for an individual branch. It contains a tree listing out all of the specs under all of the subdirectories of tests/. Since it uses the native html details and summary tags it is entirely tab-navigable and fairly accessible.

Both templates are fairly barebones with the intention being that future PRs may add more details as desired.
This PR contains about half of the report program as part of splitting it up into more managable PR sizes. It includes the following files:

* `command.go`: Wrapper around executing local commands such as git and ginkgo.
* `sum.go`: Small utility for getting the SHA-256 sum of the source code.
* `template.go`: Contains types and functions for executing the report templates.
* `tree.go`: Defines the SuiteTree type and methods for creating one from a Ginkgo report.

The excluded files are necessary to actually run the program, namely the cache and main files. However, these combined are quite large and depend on all of the files from this PR.
This PR contains the rest of the report program. It includes the last two files not part of the last PR:

* `cache.go`: Caches the trees generated from each branch and revision combination. Since a dry-run may take many minutes, caching allows the program to remain performant and responsive to changes in the templates without having to redo a dry-run.
* `main.go`: Handles the command line flags and actual running of the program. It handles retrieving values from the cache or cloning and dry running as necessary.

There are some small changes to the lint config and go.mod to allow the cache to be compressed. It uses a package already vendored so does not include additional dependencies. Compression is beneficial since the cache for the main branch alone may be over a megabyte in size but only ~40 KB when compressed.

Excluded from this PR is the GitHub workflow to actually generate the report along with some high-level documentation.
with:
path: ./report

- name: Save cached report data
Copy link
Collaborator

Choose a reason for hiding this comment

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

Would this action fit this better? https://github.com/actions/upload-artifact

If I follow your job tasks you're trying to save the output right?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

The report itself is saved as an artifact a couple lines above but this step is just to save the report program's cache (currently just the outputs of dry-run on each branch). Since I'm using a constant cache key anyway it may not be much different than just using the upload artifact action with overwrite: true though

I could use an artifact instead so if you think it fits better for this use case I can switch over to it

The final PR in the series adding the initial version of the report program, this PR adds the GitHub workflow and documentation for the report program. Once merged, all pushes will update the report using the latest version of the program and templates.
@klaskosk klaskosk force-pushed the ginkgo-report-workflow-docs branch from 02bc8d2 to cf44680 Compare February 22, 2025 02:09
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