docs: mark private attribute as deprecated in github_repository - #3298
docs: mark private attribute as deprecated in github_repository#3298mvanhorn wants to merge 3 commits into
Conversation
|
👋 Hi! Thank you for this contribution! Just to let you know, our GitHub SDK team does a round of issue and PR reviews twice a week, every Monday and Friday! We have a process in place for prioritizing and responding to your input. Because you are a part of this community please feel free to comment, add to, or pick up any issues/PRs that are labeled with |
|
@deiga - friendly ping. Approved a while back, no merge activity - let me know if anything else is needed. |
|
@mvanhorn your branch has conflicts. Please make sure that you're branch is directly mergeable before requesting work from maintainers. |
94976ac to
1beca71
Compare
|
Apologies for the noise. Rebased on main, resolved the conflict, pushed as 1beca71. Should be directly mergeable now. |
|
@mvanhorn Please stop pinging people. We will get to your PR when there is capacity for it. We really appreciate that you are contributing and value that. At the same time it's important to remember that we are hobby maintainers. It is our free time we use here. |
|
Understood, sorry for the noise. I'll leave this one alone - no more pings. Appreciate the maintenance work, this is my last comment on it. |
stevehipwell
left a comment
There was a problem hiding this comment.
Thanks for the PR @mvanhorn. We've actually update how the provider docs are generated, so there are currently two (different) ways to rebase and make this change.
The first way, which would be our preference, is to update the schema descriptions to match the documentation, update the examples, and update the template to match the generic resource template pattern.
The second easier way is to just update the examples and template with the desired content.
1beca71 to
24ef86e
Compare
|
Went with the preferred way. The branch is rebuilt on current main: argument descriptions from the old hand-written template are now schema Description fields (private documents the deprecation and points at visibility), the resource-level Description carries the GitHub App authentication note, templates/resources/repository.md.tmpl now matches the generic resource template pattern, and I added examples/resources/repository/import.sh so the generated Import section renders. docs/resources/repository.md is regenerated via tfplugindocs. go build and gofmt are clean; tfplugindocs validate still reports the pre-existing github_users gap on main, unrelated to this change. |
There was a problem hiding this comment.
Pull request overview
These provider review instructions are being used.
This PR updates the github_repository documentation generation so the private argument’s deprecation (“use visibility instead”) is reflected in the rendered docs, and aligns several schema descriptions with the generated docs.
Changes:
- Convert the
github_repositorydocs template to the repo’stfplugindocs-style rendering (.SchemaMarkdown,.ExampleFiles, import blocks). - Add/update
Descriptiontext ingithub/resource_github_repository.go(including explicitly calling outprivateas deprecated and clarifyingvisibilityprecedence). - Add an import snippet and regenerate the rendered
docs/resources/repository.md.
Reviewed changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated 5 comments.
| File | Description |
|---|---|
templates/resources/repository.md.tmpl |
Replaces the hand-written repository docs template with a tfplugindocs-driven template (schema/examples/import). |
github/resource_github_repository.go |
Adds resource-level description and expands schema Description strings (including private deprecation guidance). |
examples/resources/repository/import.sh |
Adds an import command example intended to feed docs generation. |
docs/resources/repository.md |
Updates the rendered docs output for github_repository (now schema-driven). |
|
|
||
| ```terraform | ||
| resource "github_repository" "example" { | ||
| name = "example" | ||
| description = "My awesome codebase" | ||
|
|
||
| visibility = "public" | ||
| <!-- schema generated by tfplugindocs --> | ||
| ## Schema | ||
|
|
||
| ### Required | ||
|
|
||
| - `name` (String) The name of the repository. | ||
|
|
|
5e72f53 restores both sections. The template now points On the regression you flagged: Still worth a maintainer call: you also asked why a docs-only PR touches many schema |
Migrate github_repository docs to the generated pattern per review: - Copy the documented argument descriptions into the resource schema Description fields (including private, now described as deprecated in favor of visibility) and add a resource-level Description carrying the GitHub App authentication note. - Replace templates/resources/repository.md.tmpl with the generic resource template pattern (front matter from .Description, example loop, generated schema markdown, import section). - Add examples/resources/repository/import.sh for the import section. - Regenerate docs/resources/repository.md via tfplugindocs. Closes integrations#3297 Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@Copilot flagged that switching the template to tfplugindocs-driven examples dropped both sections from the generated page, since the repo's examples are named example_1.tf / example_2.tf rather than the names .HasExamples looks for. Point tffile and codefile at the actual files in an else branch so both sections render again. docs/resources/repository.md is regenerated output, not hand-edited, so make checkdocs stays green.
- Rename examples/resources/repository/ to examples/resources/github_repository/ to match tfplugindocs convention (full resource name with provider prefix) - Rename example_*.tf files to resource*.tf to follow tfplugindocs convention - Remove fallback blocks from repository.md.tmpl to match the generic resources.md.tmpl template pattern - Regenerate docs/resources/repository.md with tfplugindocs The repository template now uses .HasExamples/.ExampleFiles and .HasImport/.ImportFile like the generic template, instead of hardcoded fallback paths. Co-authored-by: Matt Van Horn <mvanhorn@users.noreply.github.com>
5e72f53 to
a8ac159
Compare
|
Took the preferred path.
|
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 4 out of 6 changed files in this pull request and generated no new comments.
Suppressed comments (5)
github/resource_github_repository.go:69
privateis declared withConflictsWith: []string{"visibility"}, sovisibilitycannot override it—Terraform rejects configurations that set both. Document this as the replacement forprivate, not as an override.
Description: "Can be 'public' or 'private'. If your organization is associated with an enterprise account using GitHub Enterprise Cloud or GitHub Enterprise Server 2.20+, visibility can also be 'internal'. The visibility parameter overrides the private parameter.",
github/resource_github_repository.go:304
- The new schema-generated row only displays
(Deprecated)and does not render theDeprecatedfield's message, so the documented replacement withgithub_branch_defaulthas been lost. Include that migration guidance inDescriptionso it remains visible in generated docs.
Description: "The name of the default branch of the repository. NOTE: This can only be set after a repository has already been created, 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.",
github/resource_github_repository.go:332
- After switching to
SchemaMarkdown, the renderedpagesrow no longer says to usegithub_repository_pages; tfplugindocs only emits the deprecated marker, not theDeprecatedmessage. Keep the replacement/removal guidance inDescriptionso users can migrate.
Description: "The repository's GitHub Pages configuration.",
docs/resources/repository.md:67
- This generated row now tells users how to enable downloads but drops the prior warning that the attribute is no longer used and will be removed. Move the deprecation details/link from the schema's
Deprecatedfield into thehas_downloadsDescription, then regenerate this file.
- `has_downloads` (Boolean, Deprecated) Set to 'true' to enable the (deprecated) downloads features on the repository.
templates/resources/repository.md.tmpl:5
- The PR description presents this as two targeted documentation edits, but this replaces the full resource template and also migrates examples, import docs, and many schema descriptions. That materially broader scope is not documented and has introduced unrelated documentation changes; either split the tfplugindocs migration from the deprecation fix or update the PR description to explain and validate the expanded scope.
subcategory: ""
description: |-
{{ .Description | plainmarkdown | trimspace | prefixlines " " }}
@mvanhorn Please check these comments out. There might have been some information lost in the docs |
stevehipwell
left a comment
There was a problem hiding this comment.
Please add import-by-string-id.tf to the examples and use the format resource_N.tf (e.g. resource_1.tf & resource_2.tf) for the example resources adding in a comment to explain the purpose.
| ReadContext: resourceGithubRepositoryRead, | ||
| UpdateContext: resourceGithubRepositoryUpdate, | ||
| DeleteContext: resourceGithubRepositoryDelete, | ||
| Description: "This resource allows you to create and manage repositories within your GitHub organization or personal account.\n\n~> **Note** When used with GitHub App authentication, even GET requests must have the `contents:write` permission. Without it, the following arguments will be ignored, leading to unexpected behavior and confusing diffs: `allow_merge_commit`, `allow_squash_merge`, `allow_rebase_merge`, `merge_commit_title`, `merge_commit_message`, `squash_merge_commit_title` and `squash_merge_commit_message`.", |
There was a problem hiding this comment.
Please use the pattern "Resource to ..." for the description and keep it short. Additional content can be added directly to the template. Please also follow the resource structure guidance in ARCHITECTURE.md for where this should be placed.
Summary
Marks the
privateattribute as deprecated in thegithub_repositoryresource docs and updates the GitHub Pages example to usevisibilityinstead.Why this matters
The
privateattribute triggers a Terraform deprecation warning at plan time ("use visibility instead"), but the docs page doesn't mention this deprecation. Users see the warning with no guidance in the documentation.The Go source at
resource_github_repository.go:60hasDeprecated: "use visibility instead"on theprivateschema field, but this was never reflected in the markdown docs.Changes
website/docs/r/repository.html.markdown:(**DEPRECATED**)marker toprivateattribute description, with "Usevisibilityinstead." guidanceprivate = falsewithvisibility = "public"in the GitHub Pages example (the first example already usesvisibility)Testing
Verified the change matches the deprecation patterns already used for
has_downloads(line 117) andignore_vulnerability_alerts_during_read(line 145) in the same docs file.Fixes #3297
This contribution was developed with AI assistance (Claude Code).