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

github_repository - adding support for archived repositories #64

Merged
merged 8 commits into from
May 8, 2018

Conversation

tombuildsstuff
Copy link
Contributor

  • Adds support for archiving repositories
  • Updates the SDK to the latest commit
  • Fixing the failing deployment tests (by giving them unique names)

After some additional testing with this it appears repositories can only be archived through the API and not unarchived (whereas this is possible through the UI) - so this could do with some 🤔

```
 $ acctests github TestAccGithubTeam
=== RUN   TestAccGithubTeamDataSource_noMatchReturnsError
--- PASS: TestAccGithubTeamDataSource_noMatchReturnsError (3.81s)
=== RUN   TestAccGithubTeamMembership_basic
--- PASS: TestAccGithubTeamMembership_basic (4.98s)
=== RUN   TestAccGithubTeamMembership_importBasic
--- PASS: TestAccGithubTeamMembership_importBasic (2.51s)
=== RUN   TestAccGithubTeamRepository_basic
--- PASS: TestAccGithubTeamRepository_basic (4.80s)
=== RUN   TestAccGithubTeamRepository_importBasic
--- PASS: TestAccGithubTeamRepository_importBasic (3.15s)
=== RUN   TestAccGithubTeam_basic
--- PASS: TestAccGithubTeam_basic (2.26s)
=== RUN   TestAccGithubTeam_importBasic
--- PASS: TestAccGithubTeam_importBasic (1.38s)
PASS
ok      github.com/terraform-providers/terraform-provider-github/github    22.907s
```
```
$ acctests github TestAccGithubRepositoryDep
=== RUN   TestAccGithubRepositoryDeployKey_basic
--- PASS: TestAccGithubRepositoryDeployKey_basic (12.66s)
=== RUN   TestAccGithubRepositoryDeployKey_importBasic
--- PASS: TestAccGithubRepositoryDeployKey_importBasic (3.99s)
PASS
ok      github.com/terraform-providers/terraform-provider-github/github    16.677s
```
@tombuildsstuff tombuildsstuff added the Type: Feature New feature or request label Dec 19, 2017
Copy link

@catsby catsby left a comment

Choose a reason for hiding this comment

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

👍 we discussed internally adding a CustomDiff func here to perhaps change archived to a ForceNew attribute in the event we go from true back to false (unarchiving). The reason being that the API does not (at present) provide a means to unarchive a repository.

Beyond adding a note about unarchiving to the documentation, feel free to merge this without the CustomizeDiff if you'd like, or ping me for another review if you choose to add it

@@ -64,6 +64,8 @@ The following arguments are supported:
and after a correct reference has been created for the target branch inside the repository. This means a user will have to omit this parameter from the
initial repository creation and create the target branch inside of the repository prior to setting this attribute.

* `archived` - (Optional) Specifies if the repository should be archived. Defaults to `false`.
Copy link

Choose a reason for hiding this comment

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

Need to document the limitation found about unarchiving via the API. If you do choose to add a CustomizeDiff func, please document the behavior of going from true->false (unarchiving)

@paultyng
Copy link
Contributor

This should fix #73

@majormoses
Copy link
Contributor

Can we update the docs and get this merged?

@paultyng paultyng merged commit c816940 into master May 8, 2018
@paultyng paultyng deleted the archived branch May 8, 2018 15:34
@paultyng
Copy link
Contributor

This was released in v1.1.0

kfcampbell pushed a commit to kfcampbell/terraform-provider-github that referenced this pull request Jul 26, 2022
`github_repository` - adding support for `archived` repositories
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Type: Feature New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants