-
Notifications
You must be signed in to change notification settings - Fork 811
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
testing: initial code for release helper tool #2114
Conversation
There's enough functionality now to help with the initial split release. Will add more flags and goodies later as we go along and learn the ropes of juggling multiple modules |
Codecov Report
@@ Coverage Diff @@
## master #2114 +/- ##
==========================================
- Coverage 70.59% 70.53% -0.06%
==========================================
Files 104 104
Lines 12508 12508
==========================================
- Hits 8830 8823 -7
- Misses 3019 3031 +12
+ Partials 659 654 -5
Continue to review full report at Codecov.
|
internal/testing/releasehelper.go
Outdated
if r.Path == "gocloud.dev" { | ||
reqPath = "." | ||
} else { | ||
reqPath = r.Path[12:] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Alternatively, something like this:
if reqPath := strings.TrimPrefix(r.Path, "gocloud.dev"); reqPath != r.Path {
if reqPath == "" {
reqPath = "."
}
...
}
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ack. Mine feels a bit simpler, so I'll stick with it if you don't mind
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
OK. I don't really find the 12:
that readable, maybe TrimPrefix
there?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good idea, done
internal/testing/releasehelper.go
Outdated
if r.Path == "gocloud.dev" { | ||
reqPath = "." | ||
} else { | ||
reqPath = r.Path[12:] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
OK. I don't really find the 12:
that readable, maybe TrimPrefix
there?
"strings" | ||
) | ||
|
||
// TODO(eliben): add bumpversion flag that bumps version by 1, or to a version |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I have a feeling that when we add these it will be better to use commands rather than flags. Either commands that are high level like prep
which package up a bunch of lower-level things, or low-level commands that you do one at a time (releasehelper bumpversion
, releasehelper addreplace
). Otherwise it may be tricky to define the semantics for various combinations of flags (e.g., these two existing flags already depend on each other in some way; it doesn't make sense to set both or neither. With more flags, that may get more complex).
But, we can revisit later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, I see what you're saying, been thinking about this. It's hard to predict what future functionailty we'll want though and I don't want to over-YAGNI it too much right now. We'll enhance it as we go and learn the ropes of the new process
Initial release helper tool for #2111. Doesn't help with subsequent releases yet - will add that functionality as we go.