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

Mention which PR triggered build in Helm Chart Commit Message #405

Merged
merged 3 commits into from
Jan 11, 2018

Conversation

Carreau
Copy link
Member

@Carreau Carreau commented Jan 7, 2018

This should make slightly easier to figure out which PRs are in a helm
chart, and have descriptive PRs when updating mybinder.org-deploy

…m charts

This should make slightly easier to figure out which PRs are in a helm
chart, and have descriptive PRs when updating mybinder.org-deploy
@@ -154,10 +154,14 @@ def publish_pages(name, paths, git_repo, published_repo):
os.path.join(checkout_dir, f)
)
subprocess.check_call(['git', 'add', '.'], cwd=checkout_dir)
if extra_message:
exta = '\n\n%s' % extra_message
Copy link
Member

Choose a reason for hiding this comment

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

extra

@@ -13,7 +13,7 @@ echo -e "hub:\n url: $HUB_URL" > helm-chart/travis-binder.yaml

echo "building helm chart"
cd helm-chart
./build.py --commit-range ${TRAVIS_COMMIT_RANGE}
./build.py --commit-range ${TRAVIS_COMMIT_RANGE} --extra "${TRAVIS_REPO_SLUG}$(git log -1 --pretty=%B | head -n1 | sed 's/^.*\(#[0-9]*\).*/\1/')"
Copy link
Member

Choose a reason for hiding this comment

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

I guess this magically only displays the commits that are being added?

Copy link
Member Author

Choose a reason for hiding this comment

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

Well, actually as binderhub is being build for each merged PR, then it only extract the PR number.

  • ${TRAVIS_REPO_SLUG} is jupyterhub/binderhub
  • log -1 logs only the latest commit
  • --pretty=%B only the message

As the message is Merge PR #123 into master, sed 's/^.*\(#[0-9]*\).*/\1/')" extract the number.

Thus extra is only jupyterhub/binderhub#123.

It will of course not work if we push commits directly.

@choldgraf
Copy link
Member

I think it's a good idea! Can you paste what a sample output looks like? I looked through the travis logs but it doesn't seem to be building there so maybe this only shows up in an actual deployment?

@yuvipanda yuvipanda changed the title Attempt to add which PR got merged into the commit message of the hel… Mention which PR triggered build in Helm Chart Commit Message Jan 11, 2018
@yuvipanda
Copy link
Collaborator

Can you integrate this into the build.py of z2jh too, @Carreau?

@yuvipanda yuvipanda merged commit f71de2c into jupyterhub:master Jan 11, 2018
@yuvipanda
Copy link
Collaborator

(and thanks for the patch!)

yuvipanda added a commit to yuvipanda/binderhub that referenced this pull request Jan 11, 2018
choldgraf added a commit that referenced this pull request Jan 11, 2018
@Carreau
Copy link
Member Author

Carreau commented Jan 11, 2018

Can you integrate this into the build.py of z2jh too, @Carreau?

Good idea, I'll add on My todo list.
I'm starting my journey back to the US starting today (with several stops and goodbyes), so it may takes some time for me to be back online.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants