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

support branch selection #20

Closed
He-Pin opened this issue Sep 13, 2018 · 14 comments · Fixed by #2281
Closed

support branch selection #20

He-Pin opened this issue Sep 13, 2018 · 14 comments · Fixed by #2281
Labels
enhancement New feature or request

Comments

@He-Pin
Copy link
Contributor

He-Pin commented Sep 13, 2018

I have a project, which only has the SBT project layout at branch sbt, see here: https://github.com/ReactivePlatform/Pragmatic-Scala
, seems like steward needs an update to support this kind of usage.

@fthomas fthomas added the enhancement New feature or request label Sep 17, 2018
@He-Pin
Copy link
Contributor Author

He-Pin commented Sep 25, 2018

Should support multiple watched branches, maybe something like["akka2.4","master"]

@rossabaker
Copy link
Contributor

How would multiple branches work? Would it submit a PR to each branch, and let the maintainers pick which PR to merge? Try to be smart about picking the first branch?

I have a similar use case. Just thinking about how it would work.

@fthomas
Copy link
Member

fthomas commented Sep 27, 2018

I don't maintain multiple branches in my projects so I don't have an intuition what would work best in such cases. A PR for each branch sounds like a simple strategy which could be refined with more practical experience of this feature.

@manuelcueto
Copy link
Contributor

A good first step would be to support choosing from which branch to checkout and create the PR to, defaulting to Master.
I don't think that creating multiple Prs for a single update would be helpful especially if CI pipelines are costly (time or resources)

@SethTisue
Copy link
Contributor

SethTisue commented Feb 6, 2020

I work in many repos that have multiple active branches: in the Scala org (Scala itself, some of the module repos, etc), in the Lightbend org, and more generally in the course of my work on the Scala community build

as others have observed, there's really two pieces to this, one is the ability to pick a branch that isn't the GitHub default branch, the other is the ability to pick multiple branches

re: a non-default branch, sometimes the default branch isn't the most useful branch for scala-steward to target. in repos that do merges from older branches to newer branches, the best branch for scala-steward to target might be the oldest actively maintained branch. (why wouldn't that be the default branch, you might wonder? because the default branch is where new development takes place. but things like Scala version bumps, sbt version bumps, and testing library bumps aren't really new development) admittedly there is an obvious failure mode: if you only target the oldest branch, then you miss updates to dependencies that the oldest branch doesn't have. but the current scheme has an obvious failure mode too, which is that your older branches don't benefit from the steward at all.

re: multiple branches, I agree with Frank that just treating the branches separately would be a perfectly good initial starting point. some repos don't do regular merges (or any merges) from older branches to newer branches, and in those cases, the simple strategy would be fine. even in repos that do merge between branches, the simple version of the feature still wouldn't be terrible. maintainers could either 1) manually close redundant PRs, or 2) go ahead and merge redundant PRs and then sort out any merge conflicts at merge-forward time (and in many cases there wouldn't be any conflict, since git would notice that the change was already made)

@milessabin
Copy link

shapeless would also benefit from this. There are two active development branches, master and shapeless-3. Scala Steward only targets the former ... it'd be great if it could update both.

@callicles
Copy link

We could use this as well at Datalogue.

Here is how we manage our projects.

Each is using master as the state of the latest release that's the default branch.
We then have release branches that follow the pattern release-x.x.x that enable us.

Ideally for us the ideal behavior would be that for each release-x.x.x branch the scala steward would go try to make the update and PR against that branch

In the case mentioned by @rossabaker, if one of the several PRs for the same version update gets merged, I imagine we could have the bot close the sister PRs automatically. Since a user might want to merge and update in upstream or downstream.

Hope this helps

@pk044
Copy link

pk044 commented May 31, 2020

I am currently implementing it following @fthomas's proposition posted on Gitter. I'll make a PR soon enough :)

@pk044 pk044 mentioned this issue Jun 4, 2020
@kbreidenbach
Copy link

Any news on the PR as we are trying to move away from the use of master as the trunk and would like a way to pick the branch name for scala steward to check for updates?

@SethTisue
Copy link
Contributor

@kbreidenbach perhaps it will be enough for you to simply change the default branch in your repo? I don't think steward hardcodes "master", I think it goes off the default-branch setting

@exoego
Copy link
Contributor

exoego commented Oct 5, 2021

Closing as resolved.
My understanding is #2183 implemented branch selection feature.
Thanks @alejandrohdezma

@exoego exoego closed this as completed Oct 5, 2021
@alejandrohdezma
Copy link
Member

This change will be available for users of the Scala Steward GitHub Action, once scala-steward-org/scala-steward-action#268 is merged. Allowing this in any other way (either repos.md or .scala-steward.conf) would involve a bigger refactor in Scala Steward.

@fthomas
Copy link
Member

fthomas commented Oct 14, 2021

Reopening because #2183 adds branch selection for users of the GitHub Action but not for users of the public Scala Steward instance.

@fthomas fthomas reopened this Oct 14, 2021
@fthomas fthomas linked a pull request Oct 16, 2021 that will close this issue
@fthomas
Copy link
Member

fthomas commented Oct 18, 2021

#2281 made branch selection also available for users of the public Scala Steward instance, thanks to @alejandrohdezma! https://github.com/scala-steward-org/scala-steward/blob/master/docs/faq.md#can-scala-steward-update-multiple-branches-in-a-repository shows how the repos.md file needs to be updated to select a different branch or how to add multiple branches.

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

Successfully merging a pull request may close this issue.