Skip to content

fix: remove all staging files for submission#8535

Merged
rjsparks merged 1 commit intoietf-tools:mainfrom
jennifer-richards:clean-up-cancelled-submission
Feb 18, 2025
Merged

fix: remove all staging files for submission#8535
rjsparks merged 1 commit intoietf-tools:mainfrom
jennifer-richards:clean-up-cancelled-submission

Conversation

@jennifer-richards
Copy link
Copy Markdown
Member

Fixes #8534

@codecov
Copy link
Copy Markdown

codecov Bot commented Feb 14, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 88.87%. Comparing base (e33a1a8) to head (82ca936).
Report is 12 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #8535      +/-   ##
==========================================
+ Coverage   88.81%   88.87%   +0.06%     
==========================================
  Files         312      312              
  Lines       40856    40890      +34     
==========================================
+ Hits        36288    36343      +55     
+ Misses       4568     4547      -21     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

Comment thread ietf/submit/utils.py
def remove_staging_files(name, rev):
"""Remove staging files corresponding to a submission"""
basename = pathlib.Path(settings.IDSUBMIT_STAGING_PATH) / f'{name}-{rev}'
exts = [f'.{ext}' for ext in settings.IDSUBMIT_FILE_TYPES]
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

This is getting lucky and will only work as long as the set of generated filetypes is a subset of the submitable file types.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Is there any reason not to just remove anything with the given stem?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Not certain of the history, but I think IDSUBMIT_FILE_TYPES is essentially "extensions that might be associated with a submission" at this point. We use it in a couple places where we move files around. (See rename_submission_files and move_files_to_repository, at least.)

I'm inclined to keep it this way and fix it all when we refactor submission artifact handling.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

There'll be an issue to resolve when we're holding both xml2rfc and rfc2html ".html" files.

@rjsparks rjsparks merged commit 04952d5 into ietf-tools:main Feb 18, 2025
@jennifer-richards jennifer-richards deleted the clean-up-cancelled-submission branch February 18, 2025 16:38
@github-actions github-actions Bot locked as resolved and limited conversation to collaborators Feb 22, 2025
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.

Not all staging files are cleaned up when a submission is cancelled

2 participants