Skip to content

Add --clone-shallow-since-days option for the locker#12

Open
urbanikb wants to merge 2 commits intoComplianceAsCode:mainfrom
urbanikb:shallow-clone
Open

Add --clone-shallow-since-days option for the locker#12
urbanikb wants to merge 2 commits intoComplianceAsCode:mainfrom
urbanikb:shallow-clone

Conversation

@urbanikb
Copy link

@urbanikb urbanikb commented Apr 9, 2025

What

Add option to configure clone_shallow_since_days option that's already supported in the locker class.

Why

Our evidence locker is too large to fully clone locally and it makes it extremely difficult to work with the prune command without this flag.

How

  • Add a new command-line argument --clone-shallow-since-days to the _CorePruneCommand class.
  • Update the _get_locker method to accept an additional parameter clone_shallow_since_days.
  • Pass the clone_shallow_since_days attribute of the PruneLocker instance if the clone_shallow_since_days argument is provided when creating the locker.

Test

  • Executed the prune command with no issues:
$ prune push-remote https://(private repo) --config-file ./prune.json --clone-shallow-since-days 1
This is an official run.  Remote locker will be updated...
Cloning local locker for https://(private repo).  Depending on the size of your locker, this may take a while...
Locker has been cloned...
Local locker location is /var/folders/zb/6h4wth3j3g3561s518fcy70r0000gn/T/prune

Evidence (private repo file).json removed by boris.urbanik@ibm.com, tombstone applied...

Evidence (private repo file).json removed by boris.urbanik@ibm.com, tombstone applied...
Remote locker was updated...
Removing local locker...
Local locker has been removed...

Context

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.

1 participant