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

feat: authenticate with github app installation and repo standardization #221

Merged
merged 12 commits into from
Mar 26, 2024

Conversation

jmeridth
Copy link
Member

@jmeridth jmeridth commented Mar 22, 2024

Proposed Changes

I'd highly suggest this be a major version bump (3.0.0) as there are breaking changes:

  • standardize boolean environment variables (true or false)
  • drop GITHUB_SERVER_URL and instead use GITHUB_ENTERPRISE_URL for enterprise customers (matches our other repos)

Willing to go the deprecation route but this is the simpler path.

GitHub App Installation:

  • add ability to authenticate with GitHub App Installation
  • add tests for GitHub App Installation
  • add more tests for env vars

Repo updates to match standards:

  • alphabetize :allthethings:
  • add requirements-test.txt to version our testing dependencies
  • add superlinter linting action
  • add linter configs
  • update Makefile to point linting commands to our linter configs that the GitHub Action workflows use
  • add checkov exemptions to Dockerfile
    • custom user - can't do, need root for GitHub action workspace access
    • health check - don't need
  • update README, splitting authentication section (will port to other repos)
  • change .pylintrc to .python-lint (pylint default config file)
  • updated all examples to default to read contents permissions
  • standardize the pull_request_template.md

Readiness Checklist

Author/Contributor

  • If documentation is needed for this change, has that been included in this pull request
  • run make lint and fix any issues that you have introduced
  • run make test and ensure you have test coverage for the lines you are introducing

Reviewer

  • Label as either bug, documentation, enhancement, infrastructure, or breaking

@jmeridth jmeridth force-pushed the jm-github-app-auth branch from fe5862e to 87ff50b Compare March 22, 2024 13:08
@jmeridth jmeridth changed the title feat: authenticate with github app instllation feat: authenticate with github app instllation and repo standardization Mar 22, 2024
@jmeridth jmeridth marked this pull request as ready for review March 22, 2024 13:09
@jmeridth jmeridth requested a review from zkoppert as a code owner March 22, 2024 13:09
@jmeridth
Copy link
Member Author

@zkoppert yes, I agree, this is HUGE. I feel a "rip the band aid off" moment allows for it. There is still an opportunity to split the auth and env stuff out like we do in cleanowners but this gets us in right direction. If you want me to split repo standardization and GitHub App Installation auth, please let me know.

- [x] add ability to authenticate with GitHub App Installation
- [x] add tests for GitHub App Installation
- [x] add more tests for env vars

repo updates to match standards:

- [x] alphabetize :allthethings:
- [x] add requirements-test.txt to version our testing dependencies
- [x] update Makefile to point linting commands to our linter configs
      that the GitHub Action workflows use
- [x] add linter configs
- [x] add checkov exemptions to Dockerfile
  - custom user - can't do, need root for GitHub action workspace access
- [x] update README, splitting authentication section
- [x] change .pylintrc to .python-lint (pylint default config file)
- [x] updated all examples to default to read contents permissions
- [x] linted files

I'd highly suggest this be a major version change as there are breaking changes:

- [x] standardize boolean environment variables (true or false)
- [x] drop GITHUB_SERVER_URL and instead use GITHUB_ENTERPRISE_URL for enterprise
      customers (matches our other repos)

Signed-off-by: jmeridth <[email protected]>
@jmeridth jmeridth force-pushed the jm-github-app-auth branch from 87ff50b to 4fdfe82 Compare March 22, 2024 13:55
@jmeridth
Copy link
Member Author

The size of this change is daunting. There are 3 whole new files that are contributing:

  • .github/workflows/linter.py
  • test_config.py
  • docs/authenticating-with-github-app-installation.md

@zkoppert zkoppert added enhancement New feature or request breaking labels Mar 22, 2024
@jmeridth
Copy link
Member Author

Whoa. Looking into the issues.

README.md Outdated Show resolved Hide resolved
jmeridth and others added 2 commits March 22, 2024 18:29
Co-authored-by: Zack Koppert <[email protected]>
more to come

Signed-off-by: jmeridth <[email protected]>
@jmeridth
Copy link
Member Author

iterating through fixes. there are a decent amount.

jmeridth and others added 5 commits March 23, 2024 23:44
@zkoppert zkoppert changed the title feat: authenticate with github app instllation and repo standardization feat: authenticate with github app installation and repo standardization Mar 25, 2024
Signed-off-by: jmeridth <[email protected]>
- will reassess later

Signed-off-by: jmeridth <[email protected]>
@jmeridth jmeridth requested a review from zkoppert March 26, 2024 12:41
@zkoppert
Copy link
Member

👀

"""
Get the environment variables for use in the script.

Returns EnvVars object with all environment variables
"""
if not test:
Copy link
Member

Choose a reason for hiding this comment

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

Gold!

Copy link
Member

@zkoppert zkoppert left a comment

Choose a reason for hiding this comment

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

🚀

@zkoppert zkoppert merged commit 21487e1 into github:main Mar 26, 2024
6 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
breaking enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants