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

move 'last commit processes' from repo to file #522

Open
dlangille opened this issue Dec 24, 2023 · 2 comments
Open

move 'last commit processes' from repo to file #522

dlangille opened this issue Dec 24, 2023 · 2 comments

Comments

@dlangille
Copy link
Contributor

dlangille commented Dec 24, 2023

During commit processing, FreshPorts records the last commit it grabbed from a given repo. It uses this as a starting point when processing starts again.

This reference was once stored in a file. Then it was moved into the repo. I want to move it to a file again.

Reasoning:

  • The repo is a third-party dataset.
  • Let's keep our data out of it
  • where we can easily back it up.
  • Less to backup.
  • Less to restore.
  • Easily found and understood.

See LATEST_FILE used in https://news.freshports.org/2020/11/22/git-commit-processing-how-is-it-done/

See refname in https://github.com/FreshPorts/git_proc_commit/blob/master/git-to-freshports/git-delta.sh

@dlangille
Copy link
Contributor Author

dlangille commented Dec 24, 2023

NOTE: this feature is only used on the repos used by the ingress user (at ~ingress/repos/) and not on the repo used by the freshports user (at /jails/freshports/usr/ports).

This came to light when refreshing a jail from FreeBSD 13.2 to FreeBSD 14 (see #521) - the existing repo (at /usr/ports) could merely be copied over into the new jail. I think it's much easier to set up a new jail, completely independent of an existing jail, then copy over the required data. I know that sounds like the same thing, but I'm not completely sold on retaining important FreshPorts data within the FreeBSD repo.

However, backing up the FreshPorts data within a repo should be easy. Pull the values out, save them to a file, backup the file.

Something like this:

[13:52 dev-ingress01 dan ~ingress/repos/ports] % echo /usr/local/bin/git rev-parse -q --verify freshports/origin/main^{} | sudo su -fm ingress     
581c7caa3b1bbdeb0267642105eea875b4928c94

For every branch.

@dlangille
Copy link
Contributor Author

A new script has been written which dumps the required data:

https://github.com/FreshPorts/git_proc_commit/blob/master/git-to-freshports/git-last-processed-tags.sh

With that information backed up:

  • we alleviate the immediate need for moving the data from the repo to files
  • we create the need for a script to restore those settings from the file into the repos

@dlangille dlangille changed the title Relocate 'last commit processes' from repo to file move 'last commit processes' from repo to file Dec 25, 2023
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

No branches or pull requests

1 participant