Skip to content

Added code for a timestamp in log_vc_info to append to uncommitted.diff - #7358

Open
Scott-Owen-James wants to merge 6 commits into
cylc:masterfrom
Scott-Owen-James:7190
Open

Added code for a timestamp in log_vc_info to append to uncommitted.diff#7358
Scott-Owen-James wants to merge 6 commits into
cylc:masterfrom
Scott-Owen-James:7190

Conversation

@Scott-Owen-James

Copy link
Copy Markdown
Contributor

Added code for a timestamp in log_vc_info to append to uncommitted.diff
closes #7190

Check List

  • I have read CONTRIBUTING.md and added my name as a Code Contributor.
  • Contains logically grouped changes (else tidy your branch by rebase).
  • Does not contain off-topic changes (use other PRs for other changes).
  • Applied any dependency changes to both setup.cfg (and conda-environment.yml if present).
  • Tests are included (or explain why tests are not needed).
  • Changelog entry included if this is a change that can affect users
  • Cylc-Doc pull request opened if required at cylc/cylc-doc/pull/XXXX.
  • If this is a bug fix, PR should be raised against the relevant ?.?.x branch.

@Scott-Owen-James Scott-Owen-James self-assigned this Jun 30, 2026
@oliver-sanders oliver-sanders added this to the 8.7.0 milestone Jun 30, 2026
@oliver-sanders
oliver-sanders removed the request for review from ChrisPaulBennett June 30, 2026 15:17
Comment thread cylc/flow/install_plugins/log_vc_info.py Outdated
Comment thread cylc/flow/install_plugins/log_vc_info.py Outdated
Comment thread cylc/flow/install_plugins/log_vc_info.py Outdated
Comment thread cylc/flow/install_plugins/log_vc_info.py Outdated
Comment thread cylc/flow/plugins/log_vc_info.py
Comment thread cylc/flow/plugins/log_vc_info.py Outdated

diff_file = Path(
diff_location,
'uncommitted-' + str(log_num) + '.diff'

@oliver-sanders oliver-sanders Aug 4, 2026

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.

If I reinstall the same workflow three times, I end up with the following files:

$ tree ~/cylc-run/<workflow>/log/
├── install
│   ├── 01-install.log
│   ├── 02-reinstall.log
│   ├── 03-reinstall.log
│   └── 04-reinstall.log
└── version
    ├── n -> /.../uncommitted-4.diff
    ├── uncommitted-1.diff
    ├── uncommitted-2.diff
    ├── uncommitted-3.diff
    ├── uncommitted-4.diff
    └── vcs.json

For consistency, we may as well make that 01-uncommitted.diff, etc, so that folks can associate the (re)install log with the uncommitted file.

Also, why is the symlink to the latest uncommitted file called n?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

The format for the files was a change requested by @MetRonnie : #7358 (comment), as for the latest symlink being n, I assumed standard practice as we used an n to refer to the latest in different locations.

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.

The format for the files was a change requested by @MetRonnie

Ronnie suggested a two digit number, though I'm not sure what the motivation was for putting it after the name rather then before.


as for the latest symlink being n ...

  • In the run dir we have the runN symlink which points at the most recent run (e.g, run1, run23, run34, etc).
  • In log/scheduler/ we have the log symlink which points at the most recent log file.
  • In log/job/<cycle>/<task> we have the NN symlink which points at the most recent submission (e.g, 01, 23, 34, etc).

Given that we previously had a file called uncommitted.diff (and a lot of the purpose of this symlink is to prevent breaking compatibility with workflows which may load this file), we may as well use the filename here.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Alright, so change the symlink name to uncommitted.diff. And make the file numbers 2 digits, do you want me to reformat it to the way you'd prefer too or leave it as Ronnie wants it?

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.

Yes. I would default to following the existing naming pattern, but let's see if Ronnie had a design on this...

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 are two files, uncommitted.diff and vcs.json. My reasoning for putting the number after the name would be so all the uncommitted-NN.diff and vcs-NN.json would be grouped when sorted, if we end up giving vcs.json the same treatment down the line

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

Successfully merging this pull request may close these issues.

log_vc_info appends to version/uncommitted.diff on every reinstall

3 participants