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

Pushing git repositories #562

Closed
savente93 opened this issue Sep 30, 2023 · 8 comments · Fixed by #574
Closed

Pushing git repositories #562

savente93 opened this issue Sep 30, 2023 · 8 comments · Fixed by #574
Labels
C-feature request New feature request

Comments

@savente93
Copy link
Contributor

I want to suggest a new step

Topgrade already supports pulling git repositories, but I'd like the optionto also push found repositories.

Which tool is this about? Where is its repository?

Source code version management. located here https://github.com/git/git

Which operating systems are supported by this tool?

The same as the existing git step

What should Topgrade do to figure out if the tool needs to be invoked?

Probably if there are branches in the repository with unpushed commits.

Which exact commands should Topgrade run?

git push for the appropriate branches.

More information

I can imagine this might have to be an opt in feature, but I'd really appreciate it. Just pushing to the default remote, and target branches with the same name and just erroring out if either of them is not set is enough for me and probably the safest option.

Thanks for all the hard work <3

@SteveLauC SteveLauC added the C-feature request New feature request label Oct 1, 2023
@SteveLauC
Copy link
Member

This seems to be a cool feature!

What about the commit message? automatic push from Topgrade?

Something like this?

$ git add {REPO_ROOT_PATH}
$ git commit -m "automatic push from Topgrae"
$ git push

@savente93
Copy link
Contributor Author

hmmm we could do that, but that does increase the chances of doing something wrong. Because also, what files do we add? Everything? only tracked files? Initially I wasn't thinking about making commits, just making sure that already made commits are pushed to the remote. I think that if we're going to be making commits on people's behalf, it should be quite configurable

@SteveLauC
Copy link
Member

I think that if we're going to be making commits on people's behalf, it should be quite configurable

Yeah, this makes sense

Would you like to submit a patch for this feature? The functionalities Topgrade provides about git are entirely about git pull, we need to remame them to Git Pull or something so that we can differentiate these two features

@savente93
Copy link
Contributor Author

I'm okay with making a PR for this, the code for git doesn't seem too complicated, however, I will need some help understanding and using the test setup. Got any pointers on that one?

@SteveLauC
Copy link
Member

however, I will need some help understanding and using the test setup. Got any pointers on that one?

Sadly, Topgrade does not have tests for such functionalities, I don't konw if there is a good way to test Topgrade steps, maybe use some BDD tool for this?

@savente93
Copy link
Contributor Author

ahhh okay, then it's fine. I'm happy to test it locally, I just figured there was some standard test framework that I'd need to integrate with, but if that's not a requirement I'll do what I can along the way. Not sure when I'll exactly have time to work on this, but I'm happy to take a crack at it :)

@savente93
Copy link
Contributor Author

So I've been taking a look at the very first steps, and I have a question. Should we actually make a separate step for this, or should we just integrate it into the existing git step with some extra configs? I started out thinking the first, but now that I'm a bit more in the weeds, I'm not so sure. There are a lot of things that are duplicated like the repos to discover that would be very annoying to maintain duplicates of essentially, and I imagine it would be quite rare to have the two steps not overlap nearly 100%? What do you think @SteveLauC ?

@SteveLauC
Copy link
Member

There are a lot of things that are duplicated like the repos to discover that would be very annoying to maintain duplicates of essentially, and I imagine it would be quite rare to have the two steps not overlap nearly 100%?

Should we actually make a separate step for this, or should we just integrate it into the existing git step with some extra configs?

Your thought is right, adding it to the existing GitRepos makes more sense :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
C-feature request New feature request
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants