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

Allow importing of r/github_repository_autolink_reference by key prefix #1218

Merged
merged 3 commits into from
Mar 31, 2023
Merged

Allow importing of r/github_repository_autolink_reference by key prefix #1218

merged 3 commits into from
Mar 31, 2023

Conversation

marc-sensenich
Copy link
Contributor

Allow importing of r/github_repository_autolink_reference by key prefix
to allow for simpler import operations for GitHub admins as they'll be
able to import based on something they know, the key prefix, instead of
something they may need to look up, the autolink ID

Local acceptance test status

TF_ACC=1 go test -v ./... -run TestAccGithubRepositoryAutolinkReference      
?       github.com/integrations/terraform-provider-github/v4    [no test files]
=== RUN   TestAccGithubRepositoryAutolinkReference
=== RUN   TestAccGithubRepositoryAutolinkReference/creates_repository_autolink_reference_without_error
=== RUN   TestAccGithubRepositoryAutolinkReference/creates_repository_autolink_reference_without_error/with_an_anonymous_account
    resource_github_repository_autolink_reference_test.go:54: anonymous account not supported for this operation
=== RUN   TestAccGithubRepositoryAutolinkReference/creates_repository_autolink_reference_without_error/with_an_individual_account
=== RUN   TestAccGithubRepositoryAutolinkReference/creates_repository_autolink_reference_without_error/with_an_organization_account
=== RUN   TestAccGithubRepositoryAutolinkReference/imports_repository_autolink_reference_without_error
=== RUN   TestAccGithubRepositoryAutolinkReference/imports_repository_autolink_reference_without_error/with_an_anonymous_account
    resource_github_repository_autolink_reference_test.go:102: anonymous account not supported for this operation
=== RUN   TestAccGithubRepositoryAutolinkReference/imports_repository_autolink_reference_without_error/with_an_individual_account
=== RUN   TestAccGithubRepositoryAutolinkReference/imports_repository_autolink_reference_without_error/with_an_organization_account
=== RUN   TestAccGithubRepositoryAutolinkReference/imports_repository_autolink_reference_by_key_prefix_without_error
=== RUN   TestAccGithubRepositoryAutolinkReference/imports_repository_autolink_reference_by_key_prefix_without_error/with_an_anonymous_account
    resource_github_repository_autolink_reference_test.go:150: anonymous account not supported for this operation
=== RUN   TestAccGithubRepositoryAutolinkReference/imports_repository_autolink_reference_by_key_prefix_without_error/with_an_individual_account
=== RUN   TestAccGithubRepositoryAutolinkReference/imports_repository_autolink_reference_by_key_prefix_without_error/with_an_organization_account
=== RUN   TestAccGithubRepositoryAutolinkReference/deletes_repository_autolink_reference_without_error
=== RUN   TestAccGithubRepositoryAutolinkReference/deletes_repository_autolink_reference_without_error/with_an_anonymous_account
    resource_github_repository_autolink_reference_test.go:193: anonymous account not supported for this operation
=== RUN   TestAccGithubRepositoryAutolinkReference/deletes_repository_autolink_reference_without_error/with_an_individual_account
=== RUN   TestAccGithubRepositoryAutolinkReference/deletes_repository_autolink_reference_without_error/with_an_organization_account
--- PASS: TestAccGithubRepositoryAutolinkReference (54.28s)
    --- PASS: TestAccGithubRepositoryAutolinkReference/creates_repository_autolink_reference_without_error (17.37s)
        --- SKIP: TestAccGithubRepositoryAutolinkReference/creates_repository_autolink_reference_without_error/with_an_anonymous_account (0.00s)
        --- PASS: TestAccGithubRepositoryAutolinkReference/creates_repository_autolink_reference_without_error/with_an_individual_account (9.02s)
        --- PASS: TestAccGithubRepositoryAutolinkReference/creates_repository_autolink_reference_without_error/with_an_organization_account (8.35s)
    --- PASS: TestAccGithubRepositoryAutolinkReference/imports_repository_autolink_reference_without_error (18.34s)
        --- SKIP: TestAccGithubRepositoryAutolinkReference/imports_repository_autolink_reference_without_error/with_an_anonymous_account (0.00s)
        --- PASS: TestAccGithubRepositoryAutolinkReference/imports_repository_autolink_reference_without_error/with_an_individual_account (9.42s)
        --- PASS: TestAccGithubRepositoryAutolinkReference/imports_repository_autolink_reference_without_error/with_an_organization_account (8.92s)
    --- PASS: TestAccGithubRepositoryAutolinkReference/imports_repository_autolink_reference_by_key_prefix_without_error (18.01s)
        --- SKIP: TestAccGithubRepositoryAutolinkReference/imports_repository_autolink_reference_by_key_prefix_without_error/with_an_anonymous_account (0.00s)
        --- PASS: TestAccGithubRepositoryAutolinkReference/imports_repository_autolink_reference_by_key_prefix_without_error/with_an_individual_account (8.91s)
        --- PASS: TestAccGithubRepositoryAutolinkReference/imports_repository_autolink_reference_by_key_prefix_without_error/with_an_organization_account (9.11s)
    --- PASS: TestAccGithubRepositoryAutolinkReference/deletes_repository_autolink_reference_without_error (0.56s)
        --- SKIP: TestAccGithubRepositoryAutolinkReference/deletes_repository_autolink_reference_without_error/with_an_anonymous_account (0.00s)
        --- PASS: TestAccGithubRepositoryAutolinkReference/deletes_repository_autolink_reference_without_error/with_an_individual_account (0.28s)
        --- PASS: TestAccGithubRepositoryAutolinkReference/deletes_repository_autolink_reference_without_error/with_an_organization_account (0.27s)
PASS
ok      github.com/integrations/terraform-provider-github/v4/github     54.653s
                                                     

Closes #947

marc-sensenich and others added 2 commits July 7, 2022 22:24
Allow importing of r/github_repository_autolink_reference by key prefix
to allow for simpler import operations for GitHub admins as they'll be
able to import based on something they know, the key prefix, instead of
something they may need to look up, the autolink ID

Signed-off-by: Marc Sensenich <github@marc-sensenich.com>
@Esysc
Copy link

Esysc commented Feb 28, 2023

@kfcampbell this would be a very nice improvement.

@kfcampbell kfcampbell merged commit 00e1e52 into integrations:main Mar 31, 2023
avidspartan1 pushed a commit to avidspartan1/terraform-provider-github that referenced this pull request Feb 5, 2024
…ix (integrations#1218)

* Add utils for getting an autolink by key prefix and all autolinks

* Allow importing of r/github_repository_autolink_reference by key prefix

Allow importing of r/github_repository_autolink_reference by key prefix
to allow for simpler import operations for GitHub admins as they'll be
able to import based on something they know, the key prefix, instead of
something they may need to look up, the autolink ID

Signed-off-by: Marc Sensenich <github@marc-sensenich.com>

---------

Signed-off-by: Marc Sensenich <github@marc-sensenich.com>
Co-authored-by: Keegan Campbell <me@kfcampbell.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Import github_repository_autolink_reference by key
4 participants