Comments (10)
Isn't an implementation based on a regex more flexible and similar easy to implement? Because I think there may be some labels we don't want to backport e.g. all our rebuild-xxx labels. I don't think we necessarily need to optimize for ease of use. Flexibility may be more important in my opinion if you want to keep the implementation simple.
from backport-action.
Thanks for getting back to me so fast.
Flexibility wise I think regular expressions are the way to go. To keep complexity in check maybe allow a list of multiple simpler patterns that would each be sufficient for a label to be backported.
Does that sound sensible to you?
from backport-action.
Hi @mweinelt. Thanks for the great idea. I can definitely see your and other use cases for this.
There's some scoping to be done here though. For example, we could define a set of labels that are always set on backport pull requests, but we can also copy labels from the original pull request. Copying also comes with some interesting edges when considering which labels to copy, e.g. simply all labels, or all labels that are not a backport label (so it doesn't trigger the action again), all matching some configurable regex pattern, or all from a configurable set.
I'd be curious to hear from you what would be most fitting to your case, so I can keep the initial change small but also consider how to expand it in the future.
from backport-action.
Hi, I think I'm here for the same reason as mweinelt :)
copy_labels_pattern
would be great to have for nixpkgs's use case. Would you accept a PR implementing it?
from backport-action.
@mohe2015 That actually makes sense. Flexibility first, ease of use second.
@lheckemann Let's go for the copy_labels_pattern
. To make sure we don't change existing behavior, please use an empty string to mean "don't copy labels using a pattern".
from backport-action.
from backport-action.
@lheckemann Please note that your code is based on changes that are currently under battle-testing in v1-rc1
. They should improve the performance for nixpkgs significantly, but I wanted to ensure they behave correctly before releasing it as v1
(planned for the end of this month). The latest stable release is v0.0.9
.
from backport-action.
allow a list of multiple simpler patterns
I'm not sure about this. Regular expressions already support matching to multiple patterns using the |
, e.g. abc|def
. Do you think another listing syntax would be better suitable? And if so, what should that look like? It's definitely more complex to build, but if there's good reason for it then I wouldn't mind it.
How about naming of the input? What do you think about copy_labels_pattern
? It's focused, so we could separate it from a add_labels
, which could just be a comma-separated set of labels.
from backport-action.
I think what @mweinelt meant was something like pre-made regex patterns for simple cases that you could use instead of having to spin your own (possibly faulty) regex.
"Every label but backport labels" is probably a property a large amount of users would want, so this common case could be built in as a convenience option. Otherwise, all those users would have to declare a regex for that themselves.
It's a way to have maximum configurability while retaining ease of use which is something we quite like in the functional world ;)
from backport-action.
@lheckemann I would definitely welcome a PR for this, but let's agree first on the design.
We might be able to simplify the feature by copying all non-backport labels. For example, a boolean input copy_labels
. When set to true, it copies all labels from the original PR except those that match the label_pattern
input.
What do you think?
EDIT: on second thought, that's exactly what @Atemu described 💡 "Every label but backport labels"
from backport-action.
Related Issues (20)
- Automate release process
- Document action outputs
- [Feature Request] Support auto-deletion for branches if the backport PR is closed HOT 1
- Feature request: allow specifying mainline HOT 9
- PR commits are cherry-picked instead of the squashed commit HOT 8
- Feature request : backport to all open feature branches HOT 8
- Use PAT in eat-your-own-dogfood workflow
- Support glob patterns in `target_branches` input
- Improve error message on workflow file changes HOT 5
- Support skipping merge commits HOT 3
- PRs created by backport-action should trigger the CI HOT 1
- ability to backport a PR to any repo, not necessarily a fork HOT 3
- support backport, committing conflicts HOT 4
- Instructions for manually cherry-picking are incorrect as they do not skip merge commits HOT 2
- Get The successful PR numbers as an output of the action HOT 1
- Improve the error messages
- Conflict resolution `draft_commit_conflicts` provides incorrect instructions
- Conflict resolve suggestion doesn't fetch commits to cherry-pick HOT 5
- Delete the backport branch after merge HOT 2
- Workflow dispatch support
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from backport-action.