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

Artifact Report File Name #595

Open
JamesHabben opened this issue Nov 4, 2023 · 0 comments
Open

Artifact Report File Name #595

JamesHabben opened this issue Nov 4, 2023 · 0 comments

Comments

@JamesHabben
Copy link
Collaborator

JamesHabben commented Nov 4, 2023

I just noticed that there is a potential for artifact reports to conflict with each other. the artifact report filename is based on the display item. consider the alarms module code lines for reporting. it uses only the second line below.

        report = ArtifactHtmlReport('Alarms')
        report.start_artifact_report(report_folder, 'Alarms')

if artifact1 and artifact2 use category names that are different but both call their artifact report names the same (say both want settings), the last one to write will win. this forces module developers to research or hope they are choosing a unique enough name for their report. last resort, it puts responsibility on repo maintainers to manually identify and resolve conflicts.

we should consider and discuss some methods of preventing this potential collision. each thought i have has some possible downsides.

  1. include the category name (line 1 in code block above). this will help with uniqueness and make identification and resolution much easier, but would still require manual verification.
  2. generate unique value for filename. be it random or generative hash, this would provide a much lower likelihood of filename collision. downside is the filenames get ugly. a balance could be a smaller hash like CRC or smaller random appended to the filename so it keeps the readable name on the front with a few chars on the end giving the uniqueness.
  3. move artifact report files to sub-folders. this might be something to consider regardless of this problem as it would clean up the root output folder and leave a clear path for users to know what file to open. downside is it still doesnt 100% name collisions if multiple modules use the same category name, though its much easier to identify and resolve. this could also lead to a restructuring of the report files to where the common components such as header, left nav, footer are built in the main html file, and the content pane is dynamically loaded from artifact files. this can simplify the final report building process since it currently has to duplicate these common components onto each artifact report file as if its a standalone report.

any other thoughts?

it's not an immediate "problem" so theres no pressure to address right now.

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

1 participant