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

Job summary shows truncated message #442

Closed
tgehrs opened this issue Jul 18, 2024 · 2 comments
Closed

Job summary shows truncated message #442

tgehrs opened this issue Jul 18, 2024 · 2 comments

Comments

@tgehrs
Copy link
Contributor

tgehrs commented Jul 18, 2024

We have a pull request that exceeds the max_files number and the python-coverage-comment-action displays this message at the bottom of the coverage comment.

Screenshot 2024-07-18 at 2 19 47 PM

When I navigate to the workflow summary page, it shows a similar message about truncating:

https://github.com/<org>/<repo>/actions/runs/<run_id>/attempts/<attempt_num>#summary-<summary_id>

Screenshot 2024-07-18 at 2 20 10 PM

From what I can tell, the add_job_summary function is passed the same comment as was generated for the pull request, which includes the default max_files:

comment = template.get_comment_markdown(
coverage=coverage,
diff_coverage=diff_coverage,
previous_coverage=previous_coverage,
previous_coverage_rate=previous_coverage_rate,
files=files_info,
count_files=count_files,
max_files=config.MAX_FILES_IN_COMMENT,
minimum_green=config.MINIMUM_GREEN,
minimum_orange=config.MINIMUM_ORANGE,
repo_name=config.GITHUB_REPOSITORY,
pr_number=config.GITHUB_PR_NUMBER,
base_template=template.read_template_file("comment.md.j2"),
custom_template=config.COMMENT_TEMPLATE,
pr_targets_default_branch=pr_targets_default_branch,
marker=marker,
subproject_id=config.SUBPROJECT_ID,
)

github.add_job_summary(
content=comment, github_step_summary=config.GITHUB_STEP_SUMMARY
)

I would be happy to create a pull request to resolve this if needed, I would propose to either re-generate the markdown without the max_files parameter or conditionally re-generate it if the number of files exceeds the max_files setting. Is there a preference from the authors/maintainers?

Also, it might be nifty to add a link to the workflow summary from the error message, I could try to take a crack at that too as part of this fix.

@ewjoachim
Copy link
Member

ewjoachim commented Jul 18, 2024

Ah oops, I believe I completely forgot to generate the full report, you're right.

I would propose to either re-generate the markdown without the max_files parameter or conditionally re-generate it if the number of files exceeds the max_files setting. Is there a preference from the authors/maintainers?

I believe the generation is likely a few milliseconds, so either way, but likely generate it twice will lead to the clearest code.

Also, it might be nifty to add a link to the workflow summary from the error message, I could try to take a crack at that too as part of this fix.

Good idea!

And thank you for your proposal of doing the PR :) It will be a pleasure!

@tgehrs
Copy link
Contributor Author

tgehrs commented Aug 14, 2024

Closed with #444

@tgehrs tgehrs closed this as completed Aug 14, 2024
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

No branches or pull requests

2 participants