Skip to content

Job summary shows truncated message #442

@tgehrs

Description

@tgehrs

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions