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

Give dialogs/models/archive logs unique names #18365

Conversation

jrafanie
Copy link
Member

@jrafanie jrafanie commented Jan 15, 2019

https://bugzilla.redhat.com/show_bug.cgi?id=1656318

Previously, if you tried to collect logs from servers using an nfs
or smb depot, only the Archive***.zip and Current***.zip would be
uploaded. Behind, the scenes, we were uploading the automate models and
dialogs as the same Archive***.zip so they'd overwrite each other.

In MiqServer#post_logs, it calls:
post_automate_models => was using Archive***.zip
post_automate_dialogs => was using Archive***.zip
post_historical_logs => was using Archive***.zip
post_current_logs => uses Current***.zip

Therefore, the last Archive***.zip would "win", so the historical logs
would be in the Archive***.zip.

The nfs/smb code relies upon relative_path_for_upload to
determine a remote filename for upload. This method only knew about
archive and current logs and was giving everything but "Current" logs the
"Archive" filename prefix which meant dialogs/models and archived logs
would often have the same filename.

This method now uses the already known local file's name to determine this
prefix, allowing the input dialogs.zip, models.zip, current.zip, and
archive.zip to create unique names for this set of logs regardless of the
zone, server, or log timestamps.

Copy link
Member

@kbrock kbrock left a comment

Choose a reason for hiding this comment

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

Looks good.

Not sure the exact nature of the change.
Think testing instructions will help QE/readers (e.g.: If you export X, the log files will be called Y)

@jrafanie
Copy link
Member Author

jrafanie commented Jan 16, 2019

Thank you, let me reword it better.

https://bugzilla.redhat.com/show_bug.cgi?id=1656318

Previously, if you tried to collect logs from servers using an nfs
or smb depot, only the Archive***.zip and Current***.zip would be
uploaded.  Behind, the scenes, we were uploading the automate models and
dialogs as the same Archive***.zip so they'd overwrite each other.

In MiqServer#post_logs, it calls:
post_automate_models  => was using Archive***.zip
post_automate_dialogs => was using Archive***.zip
post_historical_logs  => was using Archive***.zip
post_current_logs     => uses Current***.zip

Therefore, the last Archive***.zip would "win", so the historical logs
would be in the Archive***.zip.

The nfs/smb code relies upon relative_path_for_upload to
determine a remote filename for upload. This method only knew about
archive and current logs and was giving everything but "Current" logs the
"Archive" filename prefix which meant dialogs/models and archived logs
would often have the same filename.

This method now uses the already known local file's name to determine this
prefix, allowing the input dialogs.zip, models.zip, current.zip, and
archive.zip to create unique names for this set of logs regardless of the
zone, server, or log timestamps.
@jrafanie jrafanie force-pushed the create_unique_upload_filename_for_dialogs_and_models branch from b8f13b7 to 915aff5 Compare January 16, 2019 22:01
@miq-bot
Copy link
Member

miq-bot commented Jan 16, 2019

Checked commit jrafanie@915aff5 with ruby 2.3.3, rubocop 0.52.1, haml-lint 0.20.0, and yamllint 1.10.0
2 files checked, 0 offenses detected
Everything looks fine. ⭐

@kbrock kbrock merged commit 412dbf5 into ManageIQ:master Jan 16, 2019
@kbrock kbrock added this to the Sprint 103 Ending Jan 21, 2019 milestone Jan 16, 2019
@kbrock kbrock self-assigned this Jan 16, 2019
@jrafanie jrafanie deleted the create_unique_upload_filename_for_dialogs_and_models branch January 17, 2019 15:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants