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 data source for github_actions_environment_public_key #1770

Conversation

ijcd
Copy link

@ijcd ijcd commented Jul 5, 2023

Resolves #1769


Behavior

Before the change?

  • When setting secrets for an action environment, you need to use the key for that environment. There is currently no datasource for fetching this particular key.

After the change?

  • There is now a data source for github_actions_environment_public_key

Other information


Additional info

Pull request checklist

  • Tests for the changes have been added (for bug fixes / features)
  • Docs have been reviewed and added / updated if needed (for bug fixes / features)
  • Added the appropriate label for the given change

I'm looking for guidance on how to best test this.
I'm also looking for guidance on how to update the docs. Are they auto-generated or does one edit stuff under website/?

Does this introduce a breaking change?

No

Please see our docs on breaking changes to help!

  • Yes (Please add the Type: Breaking change label)
  • No

If Yes, what's the impact:

  • N/A

Pull request type

Please add the corresponding label for change this PR introduces:

  • Bugfix: Type: Bug
  • Feature/model/API additions: Type: Feature
  • Updates to docs or samples: Type: Documentation
  • Dependencies/code cleanup: Type: Maintenance

@kfcampbell
Copy link
Member

@ijcd would you mind creating a documentation page for this new data source and linking to it in github.erb?

@ijcd
Copy link
Author

ijcd commented Jul 6, 2023

I believe I have added the docs correctly. Please take a look. I can't figure out how to build the website to test that, however. Any pointers?

% make website
make[1]: *** No rule to make target `website-provider'.  Stop.
make: *** [website] Error 2


t.Run("queries an environment public key without error", func(t *testing.T) {

config := `
Copy link
Member

Choose a reason for hiding this comment

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

Currently, this test will not run as the configuration is missing the required environment and repository parameters. You can look at github/data_source_github_actions_environment_secrets_test.go for an example of how to construct a repo and environment in a test case.

@kfcampbell
Copy link
Member

@ijcd Thanks for your patience! The docs you've added look good. The make commands concerning the website are unfortunately not working (I think since the handoff from Hashicorp? I'm not positive). I've added one comment about testing this functionality and we should be good to go here once tests are all set.

@ijcd
Copy link
Author

ijcd commented Jul 9, 2023

I added to the test case. I had to do this blind because I can't figure out how to get the tests to run. They either complain about things like skipUnlessMode if I try to run them one at a time, or that they are missing lots of env vars if I try to run the suite. Doing what is in ci.yml isn't working either. I'm missing these:

GITHUB_TEMPLATE_REPOSITORY_RELEASE_ID
GITHUB_TEMPLATE_REPOSITORY
GITHUB_TEST_COLLABORATOR
GITHUB_TEST_USER
GITHUB_TOKEN
GITHUB_ORGANIZATION

Copy link

github-actions bot commented Apr 5, 2024

👋 Hey Friends, this pull request has been automatically marked as stale because it has no recent activity. It will be closed if no further activity occurs. Please add the Status: Pinned label if you feel that this issue needs to remain open/active. Thank you for your contributions and help in keeping things tidy!

@github-actions github-actions bot added the Status: Stale Used by stalebot to clean house label Apr 5, 2024
@github-actions github-actions bot closed this Apr 12, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Status: Stale Used by stalebot to clean house
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[FEAT]: DataSource for github_actions_environment_public_key
2 participants