Repository navigation
feat: add github_user_ssh_signing_key - #2366
simonostendorf wants to merge 10 commits into
Conversation
|
@simonostendorf can you please link to the new doc you created in the |
@kfcampbell sorry forgot that. I added it now. |
875d76f to
1dde54f
Compare
f5d9e6d to
3860cf3
Compare
065e10e to
efcc88e
Compare
009fd4b to
4713629
Compare
4713629 to
8087453
Compare
8087453 to
dd6de65
Compare
|
@kfcampbell hey, can we get this merged? |
|
Would love to see this merged |
|
Hey @simonostendorf
|
dd6de65 to
171470e
Compare
Should be implemented now |
78de3d9 to
fcd48d3
Compare
fcd48d3 to
07dd337
Compare
a74c9d4 to
d06ac7d
Compare
stevehipwell
left a comment
There was a problem hiding this comment.
@simonostendorf it doesn't look like you're using hashicorp/terraform-plugin-docs to generate the docs page, this is required and CI will fail if it's not been implemented. Off the top of my head you need to add a template, the example naming needs fixing and you need to add the import examples. It also looks like you haven't followed other parts of the contribution guide such as the required linting?
d38c902 to
3d3c2e7
Compare
|
Thanks @stevehipwell, that was helpful, especially the pointer to tfplugindocs. Rebased onto main and pushed. The docs page was not generated as I was told in feburary. Added the missing template and the import examples, and regenerated. The rebase pulled in #3474, which made Two things I did beyond your comments, happy to split either out if you prefer:
I also switched the |
stevehipwell
left a comment
There was a problem hiding this comment.
Thanks for the quick response and detailed summary of the changes you made, it makes context shifting and re-reviewing much easier.
The main review point is could you please take a look at the tests for one of the updated resources and update the tests in this PR accordingly. Not the use of fewer test cases with more steps.
Thanks for pointing out what happened in #3474, that doesn't look right to me. But in a related point, could you make sure that you set the etag value to zero if the update fails (probably not needed for this resource, but it should be the pattern).
3d3c2e7 to
1e10f4e
Compare
|
Thanks @stevehipwell, that all makes sense. Rebased onto main and pushed. Tests. Took Also dropped Test helper. On Etag. The rebase also pulled in #3637, which replaced the #3474 On zeroing the etag when an update fails: there is nowhere to put it here. |
|
Hello @simonostendorf and @stevehipwell, I needed this myself, so I got it applying against The nine commits apply as they are, apart from a conflict in Drafted by Claude Opus 5.5 ( |
|
Thanks for putting this PR together and taking the time to contribute! We're temporarily moving to an issue-first model (see CONTRIBUTING.md) where only collaborators can open PRs while we work through the backlog. Because of that, I'm going to close this PR for now. I've linked it on #2365 so we don't lose your work or context when we pick that issue up. Feel free to add a 👍 or any extra notes there to help us prioritize it. |
|
Reopening this - sorry for the noise! I missed that this already had maintainer reviews and follow-up commits, so we're keeping active/reviewed PRs open while we triage them. |
|
@simonostendorf please could you rebase this PR? |
1e10f4e to
4cdc97d
Compare
stevehipwell
left a comment
There was a problem hiding this comment.
Thanks @simonostendorf, this is looking close to being ready to merge.
feat: add docs for github_user_ssh_signing_key fix: add github_user_ssh_signing_key to provider.go fix: add github_user_ssh_signing_key to github.erb fix: use tflog, context, test-structure fix: use resource-prefix, sweeper, 404-handling, direct read fix: key_id feat: import feat: adjust user_ssh_key to new structure fix: typo fix: dont overwrite key on create fix: add new fields to website fix: linting fix(tests): correct imports fix: int usage, keep url, state migration fix: readd url fix: docs, unneeded args, missing description fix: use deleteResourceOn404AndSwallow304OtherwiseReturnError fix: setting key_id, schemaVersion, website arguments
Reword both resource descriptions to the 'Resource to manage ...' form, replace the forced type assertions flagged by the forcetypeassert linter with checked ones, and set the etag attribute last.
Add the missing template for github_user_ssh_signing_key and convert the github_user_ssh_key template to the generated form. Rename both example directories to the names tfplugindocs detects and add import examples for the import block and the CLI.
Use skipUnauthenticated instead of skipUnlessMode and run the signing key subtests in parallel. Add the new sweepers to the default SWEEP list and record both resources as aligned in RESOURCES.md.
tfplugindocs derives the provider short name from the provider directory name, which breaks docs generation in any clone not named terraform-provider-github.
Follow up on integrations#3474, which landed while this PR was open: give the new signing key resource the same Optional + Computed etag with diff suppression that the other 28 resources use.
Follow github_actions_variable, listed in RESOURCES.md as having fully refactored tests. Collapse the separate create and import cases into one default subtest with four steps: create, retitle, rekey, import. The two rename steps assert ResourceActionReplace, since title and key are both ForceNew. Drop PreCheck and move skipUnauthenticated to the top of the test function, matching the resource scoped skip pattern. Replace newTestKey and newTestSigningKey with a single mustNewSshPublicKey in helpers_test.go, using t.Helper and t.Fatalf instead of discarding the errors. It generates Ed25519 rather than RSA 1024, which GitHub rejects for being under 2048 bits.
integrations#3637 replaced the Optional plus DiffSuppressFunc etag from integrations#3474 with a plain Computed attribute and CustomizeDiff: diffETag. Move the signing key resource over, reverting the block added in 0bf03e6, and regenerate the docs for both resources so etag is listed as read only.
Order the resource fields as described in ARCHITECTURE.md and place StateUpgraders directly under SchemaVersion. Store the etag only when storeEtag is enabled. Ignore the etag in the import tests.
049c9cd to
2c8d98b
Compare
|
Thanks for the review. All points are addressed:
|
Resolves #2365
Resolves #1917
Before the change?
After the change?
github_user_ssh_signing_keyresourcegithub_user_ssh_keyresource that manages ssh auth keysPull request checklist
Does this introduce a breaking change?
Please see our docs on breaking changes to help!