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

repo group and context #283

Open
pchakraborty opened this issue May 1, 2024 · 3 comments
Open

repo group and context #283

pchakraborty opened this issue May 1, 2024 · 3 comments
Assignees
Labels
enhancement New feature or request

Comments

@pchakraborty
Copy link
Collaborator

pchakraborty commented May 1, 2024

gita (https://github.com/nosarthur/gita) has the concept of repo groups and context. Essentially one can define a repo-group and execute gita commands on this group. This might be helpful when working with several related repositories.
https://github.com/nosarthur/gita?tab=readme-ov-file#define-repo-group-and-context.

mepo group create group-name repository [repository ...]

Create a group of repositories

positional arguments:
  group-name   name of group
  repository   repository that is part of the group

This might be useful for maintaining consistency across a repository hierarchy. For example, if we were make changes in GOCART (a la #288), we might do

GOCART steps

Local

(Local) Step 0: Create hierarchical group

mepo group create h-gocart GOCART GEOSchem_GridComp GEOSgcm_GridComp GEOSgcm_GridComp

(Local) Step 1: Create branch in GOCART and its upstream repositories

mepo checkout -b feature/<user>/gocart/some-change --group h-gocart

(Local) Step 2: Modify GOCART files and commit

Commit all changes to feature/<user>/gocart/some-change in GOCART and its upstream repositories

mepo commit -m "message" --group h-gocart

(Local) Step 3: Save current state and update registry

mepo save --group h-gocart

save ensures that all repositories, that are part of h-gocart, are clean, i.e. all sources have been committed to a branch. It then writes a new state file in .mepo and updates the registry (components.yaml).

(Local) Step 4: Push all changes

Push `feature//gocart/some-change from GOCART and its upstream repositories to remote

mepo push --group h-gocart

Note

We can further simplify the command by defining a context

mepo context h-gocart

Then the mepo commands from earlier become

mepo checkout -b feature/<user>/gocart/some-change
mepo commit -m "message"
mepo save
mepo push

and apply to each member of h-gocart.

@pchakraborty pchakraborty self-assigned this May 1, 2024
@pchakraborty
Copy link
Collaborator Author

@tclune @amdasilva @mathomp4 Thoughts?

@mathomp4
Copy link
Member

mathomp4 commented May 2, 2024

Hmm. Interesting. I'll have to stare at that for a bit to absorb it. Though I suppose the "automatic" grouping is sort of interesting.

@tclune
Copy link
Contributor

tclune commented May 2, 2024

Arlindo did look into this prior to proposing the "man pages" you have for HEPO. I don't recall which aspects led him to want to develop a separate tool, but my memory is that he thought gita was a great proof of concept.

@pchakraborty pchakraborty added the enhancement New feature or request label May 2, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

3 participants