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

Add option to push to gh-pages #73

Merged
merged 2 commits into from
Aug 27, 2020
Merged

Conversation

unguiculus
Copy link
Member

@unguiculus unguiculus commented Aug 10, 2020

This adds the option to push the index.yaml file, either directly to the GitHub Pages branch, which is now configurable, or via pull request.

Signed-off-by: Reinhard Nägele unguiculus@gmail.com

Signed-off-by: Reinhard Nägele <unguiculus@gmail.com>
@unguiculus
Copy link
Member Author

I'd like to do a little refactoring in a follow-up PR in order to improve testability. With the current code, it is hard to add tests.

@unguiculus unguiculus marked this pull request as ready for review August 11, 2020 19:57
Copy link
Member

@scottrigby scottrigby left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Some comments but overall this is great to add to the main tool. Looking forward to cleaning up helm/chart-releaser-action after this 👏

@@ -16,6 +16,7 @@ package cmd

import (
"github.com/helm/chart-releaser/pkg/config"
"github.com/helm/chart-releaser/pkg/git"
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@unguiculus what do you think about using https://github.com/go-git/go-git instead of our own package that shells out?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We had used that in a client project and dropped it. We hit bugs and had various issues with it and it covers only a small subset of Git which wasn't enough for us. Plus, it's not really straight forward to use. I'd rather not use it.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

'worktree' is not supported BTW.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I saw that in the compatibility doc, but read through https://github.com/go-git/go-git/blob/master/worktree_test.go, which led me to think the doc just wasn't updated. But I don't have any real world experience using that package, so definitely trust your judgement 👍 My main thought was it could be cool to be able to run this without git as a dependency. Maybe something to reevaluate later?

cr/cmd/index.go Outdated
Comment on lines 60 to 62
flags.String("pages-branch", "gh-pages", "The GitHub pages branch")
flags.Bool("push", false, "Push index.yaml to the GitHub Pages branch (must not be set if --pr is set)")
flags.Bool("pr", false, "Create a pull request for index.yaml against the GitHub Pages branch (must not be set if --push is set)")
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice 👍
Cross-referencing discussion in helm/chart-releaser-action#33 about options design

return true, nil
}

worktree, err := r.git.AddWorktree("", "origin/"+r.config.PagesBranch)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Don't want to scope creep too hard here, but we may now want to add a remote config option as well?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good point. Added it.

Signed-off-by: Reinhard Nägele <unguiculus@gmail.com>
@unguiculus unguiculus requested a review from scottrigby August 26, 2020 20:08
Copy link
Member

@scottrigby scottrigby left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm 🙌

@unguiculus unguiculus merged commit 23a2674 into helm:master Aug 27, 2020
@unguiculus unguiculus deleted the feature/gh-pages branch August 27, 2020 06:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants