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
Implements command to change a job location. #739
Conversation
dd10f89
to
c12769a
Compare
c12769a
to
258115d
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
See comments.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Let's go with your suggestion from this comment.
If a job has a user_visible_url set, that key's value is left unchanged by a --change-location run.
Updated per our discussion. I ran the same manual tests documented in the initial PR description, plus verified that no history gets moved if a job has The thing to note below is the absence of a string like "Moved {n} snapshots of...":
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just two small style/wording comments. Can you also add an entry to CHANGELOG.md
in the "Added" category describing the new feature? (+ PR number + your name as contributor, like the other examples already in the file)
After that, I think this is finally ready to merge. Thanks for pushing this PR forward, I think it turned out quite nice.
Ok, all set. Thanks for the feedback! |
Merged, thanks! |
This PR adds a new command line option
--change-location
to change the location (i.e.url
,command
, ornavigate
) of a job while preserving history for that job. The tool ensures that the new location string is unique within the list of jobs prior to changing anything.Note that in the (admittedly contrived) scenario of having abandoned entries in a redis db that use the user-provided new location (perhaps from old runs that were never garbage-collected) then those abandoned entries will be clobbered by the
--change-location
option. I think that should be ok, but I'm sure I could find a way to preserve those entries if needed.I did some manual testing to verify functionality.
Save the starting version of a simple urls YAML:
Change location of all 4 jobs:
Compare the updated urls YAML to the initial reference version. Appropriate key values are updated according to job type:
Existing history is moved with --change-location:
I confirmed the same behavior with
--cache redis://127.0.0.1:6379
Fixes #300