-
Notifications
You must be signed in to change notification settings - Fork 0
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
Improve promotion comment. #31
Improve promotion comment. #31
Conversation
301f819
to
884262f
Compare
internal/pkg/githubapi/github.go
Outdated
// returns a slice containing paths in common. | ||
func identifyCommonPaths(promotionPaths []string, targetPaths []string) []string { | ||
if (len(promotionPaths) == 0) || (len(targetPaths) == 0) { | ||
return []string{} |
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.
return []string{} | |
return nil |
internal/pkg/githubapi/github.go
Outdated
if (len(promotionPaths) == 0) || (len(targetPaths) == 0) { | ||
return []string{} | ||
} | ||
commonPaths := []string{} |
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.
commonPaths := []string{} | |
var commonPaths []string |
continue | ||
} | ||
// strings.HasPrefix is used to check that the target path and promotion path match instead of | ||
// using 'pp == tp' because the promotion path is targetPath + component. |
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.
Is this always true? I'm missing some context about how the paths are built/where they come from so it isn't fully clear to me that this covers all cases.
If this does the job and solves the current issue I'm happy to get it in for now.
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.
bce2a55
to
a2ced16
Compare
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.
Cool, also fix the lint errors.
0070c89
to
4840d62
Compare
Promotion comment used to list all the values in the 'targetPaths' key, ignoring the promotionAllow and promotionBlock lists. This PR limits the comment to only paths that are being promoted.
4840d62
to
5c71edd
Compare
Description
Please provide a meaningful description of what this change will do, or is for. Bonus points for including links to related issues, other PRs, or technical references.
Note that by not including a description, you are asking reviewers to do extra work to understand the context of this change, which may lead to your PR taking much longer to review, or result in it not being reviewed at all.
Type of Change
Checklist