-
Notifications
You must be signed in to change notification settings - Fork 93
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
install: record version control information #3849
Comments
Seems sensible. Maybe remove the
It seems there's stuff out there, but it might be overkill for our simple requirements. (Unless we want to do more than just interrogate the version). https://github.com/vcs-python/libvcs |
Happy with overkill so long as it does the job. I found a couple of others in my travels, though finding one which is able to obtain the staged/unstaged diff may by difficult. Ideally we would support at least |
Am I right in my understanding that this will need a new event type cylc-flow/cylc/flow/main_loop/__init__.py Lines 138 to 153 in be1dfb5
And if so, is @wxtim working on that as part of #3819? Or should I have a go? |
Yes, this would use the post_install(src_dir, run_dir, cli_opts) -> dict |
If we can't find a library to do this for us, things we need to be careful of:
|
Looks like there isn't a nice library we can grab for purpose, will need to implement from scratch, shouldn't be too bad (famous last words), the required SVN functionality was provided by Rose2019. Information we need to capture:
Would suggest dumping the diff (if present) in a patch file and the metadata in a Cylc/Rose readable (non-nested) INI-like format. |
Do we want to include the diff of untracked files in the case of git? (It's doable but there isn't a straightforward command for getting the diff of untracked files, surprisingly) |
I was just thinking that from a provenance perspective perspective it would be good to have a note somewhere recording that there were untracked files as these could very well affect results. Just listing them would be enough if we were to do this, purposefully ignored files (e.g. I don't think Rose2019 records this information so not needed for Cylc8 but a nice-to-have anyway. |
How should this be for multiline values, like statuses? status = """
M app/ancil_sstice/rose-app.conf
M app/um/opt/rose-app-stashpack1.conf
M app/um/rose-app.conf
M rose-suite.conf
""" or status=M app/ancil_sstice/rose-app.conf
=M app/um/opt/rose-app-stashpack1.conf
=M app/um/rose-app.conf
=M rose-suite.conf Personally, I prefer the former |
Is this plugin supposed to be enabled by default? (With what I've written so far, it is enabled by default, and I'm not sure how it would be made opt-in) |
I don't think there is a particularly good use case for turning this plugin off.
|
@oliver-sanders is that quoted "Off topic comment on plugins" coming from you? (It seems somewhat at odds with the un-quoted statement that precedes it!) |
The operating words there were this plugin, trying to avoid polluting this issue with a larger plugin debate so I've dumped some ideas I've been batting around for a while into an issue - #4106. In this case I don't think the plugin really requires any configuration, however, other plugins might and the main loop plugins already do. I had a look into centralising the plugin functionality a while back but couldn't come up with an ideal solution (the more you configure up front the more work Cylc needs to do up front). |
closely related to #3819
Re-implement the Rose ability to record version control information.
Write a plugin (using the on-install entry point developed in #3819) that runs on workflow installation to detect if the workflow is being installed from a version controlled working copy and if so record the revision along with any un-committed diff.
This info should get dumped into a file somewhere in the workflow run directory.
This should work for git and svn.
Questions:
~/<flow>/log/version-control/<timestamp>-<run_mode>
The text was updated successfully, but these errors were encountered: