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

Support GitHub Enterprise for GitHub Release Source #505

Open
wants to merge 4 commits into
base: main
Choose a base branch
from

Conversation

crhntr
Copy link
Member

@crhntr crhntr commented Aug 15, 2024

story: TPCF-26493

@crhntr
Copy link
Member Author

crhntr commented Aug 15, 2024

Some questions we had while implementing this:

  • Do we need to provide a CA to the http.Client TLS config? Looks like no. We have not tested kiln from CI yet.
  • Do we have API mismatches because our GitHub Enterprise deployment is different from Github.com? Both commands worked with the current go-github version so it seems to work ok.
  • Do we have different api and upload URLs? Nope, it works... also we are not doing uploads in the commands so we are likely not exercising this configuration.

Known Issue
If you have multiple github release sources (ie some releases on GitHub.com and some on GitHub Enterprise), release-notes will fail to generate.

To fix this, we need to change how the GitHub client used for release note generation is configured. Instead of passing the github-token as a flag we need to properly parse release source client for each release.

@crhntr crhntr force-pushed the add-github-enterprise-support branch from 4a95629 to 40e8979 Compare August 15, 2024 19:45
story: TPCF-26493

Co-authored-by: Joe Eltgroth <[email protected]>
@crhntr crhntr force-pushed the add-github-enterprise-support branch from 40e8979 to 173c1aa Compare August 15, 2024 19:46
@crhntr crhntr added enhancement tas-slingshots Created by https://github.com/orgs/pivotal-cf/teams/tas-strategic-initiatives-slingshot labels Aug 15, 2024
@crhntr crhntr changed the title Support GitHub Enterprise for GitHub Release Source and Release Note Generation Support GitHub Enterprise for GitHub Release Source Aug 16, 2024
Co-authored-by: Joe Eltgroth <[email protected]>

story: TPCF-26493

this is required for generating tile release notes
@crhntr crhntr force-pushed the add-github-enterprise-support branch from 33c9c56 to b2ce0ba Compare August 16, 2024 23:11
@@ -20,6 +20,8 @@ func InterpolateAndParseKilnfile(in io.Reader, templateVariables map[string]any)
return Kilnfile{}, fmt.Errorf("unable to read Kilnfile: %w", err)
}

fmt.Println(string(kilnfileYAML))
Copy link
Member

Choose a reason for hiding this comment

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

Did you mean to remove this print statement?

Copy link
Member Author

Choose a reason for hiding this comment

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

Yes. My bad. Thanks for catching this.

@pvaramballypivot
Copy link
Member

pvaramballypivot commented Sep 10, 2024

@crhntr I tested the changes locally and here's what I noticed

  1. It doesn't seem to be backward compatible. The command now requires artifactory_username, artifactory_password and github_access_token to be passed in the command as variables. Previously just setting the GITHUB_TOKEN env variable was enough. This is not a huge change but it would require updating scripts.
  2. The output is missing the details of the bumps. Check out this story where I have attached 2 files - "current_release_output.md" run from the current released version of kiln, and "pr_changes_output.md" run from the changes in this PR. Please compare the 2 to see more.

@crhntr
Copy link
Member Author

crhntr commented Sep 19, 2024

It doesn't seem to be backward compatible. The command now requires artifactory_username, artifactory_password and github_access_token to be passed in the command as variables. Previously just setting the GITHUB_TOKEN env variable was enough. This is not a huge change but it would require updating scripts.

I had hoped to keep it backwards compatible. Unfortunately, now we need a second configuration value (the GitHub enterprise host). We could add another environment variable for that, but we already have it configured in the Kilnfile. Also with the introduction of a second GitHub host, some BOSH Releases could come from enterprise and others from open source, each host requires a different token and we use the Kilnfile.lock to resolve which credentials to use.

For local development, tile authors should have "~/.kiln/credentials.yml" configured so only automation scripts should break.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement ready-for-review tas-slingshots Created by https://github.com/orgs/pivotal-cf/teams/tas-strategic-initiatives-slingshot
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants