-
Notifications
You must be signed in to change notification settings - Fork 777
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: Ability to Manage Codespaces Secrets #1729
Conversation
The 'go-github' client still needs to be updated once its ready |
Type: Feature
Type: Feature
Type: Feature
@KenSpur thank you for contributing! Do you mind adding the corresponding documentation and link to documentation in the |
@kfcampbell Yes will do, also looking into testing etc. |
@KenSpur thank you for contributing? Is this ready for review/merging? |
@kfcampbell I was able to manualy test the 'github_codespaces_secret' and 'github_codespaces_secret'. Concerning 'github_codespaces_organization_secret' i am getting 404's which might be because of my token and org config, since when i uses the api or cli i get the same. Automated testing still needs a look which ill do today. Also i have found a bug in how the repo secrets handle an update to the repoName, they should probably forceNew as its used in the resource id which can't handle changes if im correct. I am wondering if i should fix this in this PR or keep it similar to the other secrets and fix it later? Il update my progress later today. |
Ah found the issue concerning the 404's on 'github_codespaces_organization_secret', i needed to upgrade my account to the 4$ plan. It is weird though and might be a bug in the api because manualy trough the webapp i was able to create a codespace secret on the non upgraded org on 06/21 (2days ago). |
@kfcampbell ready for review/merging! Ill open a bug Issue concerning repository renames, so that all repo secrets can be fixed at once in a focused manner ^^ (#1753) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I had a question around importation, otherwise this looks good to me.
Read: resourceGithubCodespacesSecretRead, | ||
Update: resourceGithubCodespacesSecretCreateOrUpdate, | ||
Delete: resourceGithubCodespacesSecretDelete, | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why does this resource not support importing?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It seems to not be implemented on the resourceGithubActionsSecret
or resourceGithubDependabotSecret
aswel, though org secrets do have it. Should i open an issue to look into all 3?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@KenSpur that would be excellent, thanks! In an ideal world, each resource should support importing.
## Attributes Reference | ||
|
||
* `created_at` - Date of actions_secret creation. | ||
* `updated_at` - Date of actions_secret update. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If/when import is added for codespaces secrets, we should update this doc here.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm happy to have importing tackled in separate PRs. Thank you for contributing!
This PR contains the following updates: | Package | Type | Update | Change | |---|---|---|---| | [github](https://registry.terraform.io/providers/integrations/github) ([source](https://togithub.com/integrations/terraform-provider-github)) | required_provider | minor | `5.28.1` -> `5.29.0` | --- ### Release Notes <details> <summary>integrations/terraform-provider-github (github)</summary> ### [`v5.29.0`](https://togithub.com/integrations/terraform-provider-github/releases/tag/v5.29.0) [Compare Source](https://togithub.com/integrations/terraform-provider-github/compare/v5.28.1...v5.29.0) #### What's Changed - fix: support team slug in github_team_membership by [@​kristian-lesko](https://togithub.com/kristian-lesko) in [https://github.com/integrations/terraform-provider-github/pull/1751](https://togithub.com/integrations/terraform-provider-github/pull/1751) - Fixes accidental deletion of Repository resource from state by [@​t0yv0](https://togithub.com/t0yv0) in [https://github.com/integrations/terraform-provider-github/pull/1750](https://togithub.com/integrations/terraform-provider-github/pull/1750) - feat: Add GitHub Organization Custom Role Resource and Data Source by [@​cailen](https://togithub.com/cailen) in [https://github.com/integrations/terraform-provider-github/pull/1700](https://togithub.com/integrations/terraform-provider-github/pull/1700) - Fix typo in deployment branch policy import by [@​bpaquet](https://togithub.com/bpaquet) in [https://github.com/integrations/terraform-provider-github/pull/1758](https://togithub.com/integrations/terraform-provider-github/pull/1758) - Fix `resourceGithubDependabotOrganizationSecretCreateOrUpdate` by [@​frankywahl](https://togithub.com/frankywahl) in [https://github.com/integrations/terraform-provider-github/pull/1759](https://togithub.com/integrations/terraform-provider-github/pull/1759) - \[Bug]: Renaming github_repository doesn't taint full_name attribute by [@​KenSpur](https://togithub.com/KenSpur) in [https://github.com/integrations/terraform-provider-github/pull/1756](https://togithub.com/integrations/terraform-provider-github/pull/1756) - feat: Ability to Manage Codespaces Secrets by [@​KenSpur](https://togithub.com/KenSpur) in [https://github.com/integrations/terraform-provider-github/pull/1729](https://togithub.com/integrations/terraform-provider-github/pull/1729) #### New Contributors - [@​kristian-lesko](https://togithub.com/kristian-lesko) made their first contribution in [https://github.com/integrations/terraform-provider-github/pull/1751](https://togithub.com/integrations/terraform-provider-github/pull/1751) - [@​t0yv0](https://togithub.com/t0yv0) made their first contribution in [https://github.com/integrations/terraform-provider-github/pull/1750](https://togithub.com/integrations/terraform-provider-github/pull/1750) - [@​cailen](https://togithub.com/cailen) made their first contribution in [https://github.com/integrations/terraform-provider-github/pull/1700](https://togithub.com/integrations/terraform-provider-github/pull/1700) - [@​frankywahl](https://togithub.com/frankywahl) made their first contribution in [https://github.com/integrations/terraform-provider-github/pull/1759](https://togithub.com/integrations/terraform-provider-github/pull/1759) - [@​KenSpur](https://togithub.com/KenSpur) made their first contribution in [https://github.com/integrations/terraform-provider-github/pull/1756](https://togithub.com/integrations/terraform-provider-github/pull/1756) **Full Changelog**: integrations/terraform-provider-github@v5.28.1...v5.29.0 </details> --- ### Configuration 📅 **Schedule**: Branch creation - At any time (no schedule defined), Automerge - At any time (no schedule defined). 🚦 **Automerge**: Disabled by config. Please merge this manually once you are satisfied. ♻ **Rebasing**: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox. 🔕 **Ignore**: Close this PR and you won't be reminded about this update again. --- - [ ] <!-- rebase-check -->If you want to rebase/retry this PR, check this box --- This PR has been generated by [Renovate Bot](https://togithub.com/renovatebot/renovate). <!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiIzNS4xNDQuMCIsInVwZGF0ZWRJblZlciI6IjM1LjE0NC4wIiwidGFyZ2V0QnJhbmNoIjoibWFpbiJ9--> Co-authored-by: greyrock-bot <1583719+greyrock-bot[bot]@users.noreply.github.com>
* add github_codespaces_secret * use repository as repoName * add github_codespaces_organization_secret * add github_codespaces_user_secret * fix version * add docs * fix id conversion * add codespaces_*public_key data source * switch back to use of name/full_name * update org test * update repo test * remove user secret visibiltiy prop & update tests --------- Co-authored-by: Keegan Campbell <me@kfcampbell.com>
Resolves #1662 #915
Behavior
Before the change?
After the change?
github_codespaces_secret
& datagithub_codespaces_secrets
,github_codespaces_public_key
github_codespaces_organization_secret
& datagithub_codespaces_organization_secrets
,github_codespaces_organization_public_key
github_codespaces_user_secret
& datagithub_codespaces_user_secrets
,github_codespaces_user_public_key
Other information
Additional info
Pull request checklist
Does this introduce a breaking change?
Please see our docs on breaking changes to help!
Type: Breaking change
label)Pull request type
Type: Feature