Skip to content
This repository was archived by the owner on Sep 3, 2025. It is now read-only.

Conversation

@derrickstolee
Copy link
Collaborator

Moving along with the CLI implementation, here is the basic starting point for init and update.

The init command does not set up the maintenance, but that will be done later.

The update command creates a new tip bundle, but does not squash the oldest bundle when the bundle list grows too large.

Create more helper packages in 'internal' space, including:

* repo: Information about a repository including the Git dir and
  location of the web content.

* core: Important information about the root of our filesystem data
  stores.

* bundles: Information about working with a bundle or a list of bundles.

Apply these new packages to complete the implementation of the 'init'
subcommand. It now creates the 'bundle-list' file in the web directory
and the 'bundle-list.json' file in the Git directory.
@derrickstolee derrickstolee self-assigned this Aug 23, 2022
@derrickstolee derrickstolee changed the title CLI Part 1: init and update git-bundle-server CLI Part 1: init and update Aug 23, 2022
Copy link

@dscho dscho left a comment

Choose a reason for hiding this comment

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

This looks like a very good start to me.

Caveat: I am not regularly developing in Go, and can only cargo-cult that language. Having said that, the proposed code looks correct to me.

Copy link

@dscho dscho left a comment

Choose a reason for hiding this comment

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

Sorry, by mistake I only had reviewed the first commit before.

Be sure to parse the existing bundle headers in order to get the
previous refs, then use those as prerequisites for the new incremental
bundle. It's not enough to only use the refs from the previous layer,
since perhaps not all refs were updated or maybe a ref was force-pushed.
@derrickstolee derrickstolee merged commit a7329d3 into main Aug 25, 2022
@dscho dscho deleted the stolee/cli-1 branch August 26, 2022 06:40
derrickstolee added a commit that referenced this pull request Sep 21, 2022
…bundle and the `update-all` subcommand

Based on #2.

The `update` subcommand now notices when there are more than 5 bundles and squashes the oldest ones into a new "base" bundle. The bundle is renamed but keeps the maximum creation token from that group of bundles.

Modified some of the parameters, especially those in the `git` package to avoid cyclic package dependencies. Also used struct pointers more often.

Repository routes are now stored in a new `routes` file (currently plaintext with line-separated list of routes).

The new `update-all` subcommand runs the `update` subcommand on all registered routes. It also passes any remaining arguments down to the subcommand, which will help when we add the `--daily` and `--hourly` options.
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants