magic-modules icon indicating copy to clipboard operation
magic-modules copied to clipboard

Improve links to sections within the `composer_environment` docs

Open SarahFrench opened this issue 2 years ago • 7 comments

Description

Closes https://github.com/hashicorp/terraform-provider-google/issues/11773

This PR addresses the issue with this:

  • Overrides links automatically added to argument names by the Registry by adding <a> tags to the argument names with name values chosen to be unique to each argument (e.g. so each argument called cpu can be linked to separately)
  • ⚠️ I'm happy to drop this from the PR if it's introducing too much stuff to maintain, but my rationale was that it's tolerable as it's limited to just the one file!

Bonus fixes:

  • Fixes instances of the documentation saying Structure is documented below. without a linking to the section
  • Updates name values used for links to 'nested' sections - where sections of the same name are present I've updated the values to have _2 if they're in the Cloud composer 2 argument reference section.
    • I'm hoping this will allow linking to the arguments that would have been 'shadowed' by similarly named arguments higher up the page, while minimising the effect on any links to specific arguments on the page that exist elsewhere

Overriding links

If you use the Terraform Registry's doc preview tool and put this in the form field:

* `foobar`
  *  Links to itself
* `foobar`
  *  Links to the top foobar
* `foobar`
  *  Links to the top foobar

...you can see that the bullet points are each turned into links, but they are the same link and would show the user the first instance of foobar only.

Changing it to something like this allows linking to specific arguments with the same name:

* `foobar`
  *  Links to itself
* `foobar`
  *  Links to the top foobar
* <a href="#foobar-special" name="foobar-special">`foobar`</a>
  *  Links to itself

This PR does this for each argument... and needed to get creative with the values of name for arguments in nested blocks. I chose to take the name value of the block and add the argument name at the end.

List

If this PR is for Terraform, I acknowledge that I have:

  • [x] Searched through the issue tracker for an open issue that this either resolves or contributes to, commented on it to claim it, and written "fixes {url}" or "part of {url}" in this PR description. If there were no relevant open issues, I opened one and commented that I would like to work on it (not necessary for very small changes).
  • [x] Generated Terraform, and ran make test and make lint to ensure it passes unit and linter tests.
  • [x] ~~Ensured that all new fields I added that can be set by a user appear in at least one example (for generated resources) or third_party test (for handwritten resources or update tests).~~ N/A
  • [x] ~~Ran relevant acceptance tests (If the acceptance tests do not yet pass or you are unable to run them, please let your reviewer know).~~ N/A
  • [x] Read the Release Notes Guide before writing my release note below.

Release Note Template for Downstream PRs (will be copied)


SarahFrench avatar Jul 26 '22 17:07 SarahFrench

Oops! It looks like you're using an unknown release-note type in your changelog entries:

  • REPLACEME

Please only use the types listed in https://github.com/GoogleCloudPlatform/magic-modules/blob/master/.ci/RELEASE_NOTES_GUIDE.md.

modular-magician avatar Jul 26 '22 17:07 modular-magician

Hello! I am a robot who works on Magic Modules PRs.

I've detected that you're a community contributor. @scottsuarez, a repository maintainer, has been assigned to assist you and help review your changes.

:question: First time contributing? Click here for more details

Your assigned reviewer will help review your code by:

  • Ensuring it's backwards compatible, covers common error cases, etc.
  • Summarizing the change into a user-facing changelog note.
  • Passes tests, either our "VCR" suite, a set of presubmit tests, or with manual test runs.

You can help make sure that review is quick by running local tests and ensuring they're passing in between each push you make to your PR's branch. Also, try to leave a comment with each push you make, as pushes generally don't generate emails.

If your reviewer doesn't get back to you within a week after your most recent change, please feel free to leave a comment on the issue asking them to take a look! In the absence of a dedicated review dashboard most maintainers manage their pending reviews through email, and those will sometimes get lost in their inbox.


modular-magician avatar Jul 26 '22 17:07 modular-magician

Oops! It looks like you're using an unknown release-note type in your changelog entries:

  • REPLACEME

Please only use the types listed in https://github.com/GoogleCloudPlatform/magic-modules/blob/master/.ci/RELEASE_NOTES_GUIDE.md.

modular-magician avatar Jul 26 '22 17:07 modular-magician

Hi! I'm the modular magician. Your PR generated some diffs in downstreams - here they are.

Diff report:

Terraform GA: Diff ( 1 file changed, 70 insertions(+), 72 deletions(-)) Terraform Beta: Diff ( 1 file changed, 70 insertions(+), 72 deletions(-)) TF Validator: Diff ( 2 files changed, 3 insertions(+), 3 deletions(-))

modular-magician avatar Jul 26 '22 18:07 modular-magician

Hi! I'm the modular magician. Your PR generated some diffs in downstreams - here they are.

Diff report:

Terraform GA: Diff ( 1 file changed, 63 insertions(+), 65 deletions(-)) Terraform Beta: Diff ( 1 file changed, 63 insertions(+), 65 deletions(-)) TF Validator: Diff ( 2 files changed, 3 insertions(+), 3 deletions(-))

modular-magician avatar Jul 26 '22 18:07 modular-magician

Tests analytics

Total tests: 2122 Passed tests 1892 Skipped tests: 226 Failed tests: 4

Action taken

Triggering VCR tests in RECORDING mode for the tests that failed during VCR. Click here to see the failed tests TestAccComputeInstance_soleTenantNodeAffinities|TestAccCGCSnippet_eventarcWorkflowsExample|TestAccPrivatecaCertificateAuthority_privatecaCertificateAuthoritySubordinateExample|TestAccPrivatecaCertificateAuthority_subordinateCaActivatedByFirstPartyIssuerOnCreation

modular-magician avatar Jul 26 '22 19:07 modular-magician

Tests passed during RECORDING mode: TestAccCGCSnippet_eventarcWorkflowsExample[view]

Tests failed during RECORDING mode: TestAccPrivatecaCertificateAuthority_subordinateCaActivatedByFirstPartyIssuerOnCreation[view] TestAccPrivatecaCertificateAuthority_privatecaCertificateAuthoritySubordinateExample[view] TestAccComputeInstance_soleTenantNodeAffinities[view]

Please fix these to complete your PR View the build log or the debug log for each test

modular-magician avatar Jul 26 '22 19:07 modular-magician

sorry I missed this PR Sarah, feel free to ping me next time or ping on the PR.

Is this PR now obsolete ?

ScottSuarez avatar Sep 09 '22 19:09 ScottSuarez

@ScottSuarez Sorry, I should have done that!

I closed the PR because I felt that it might be tough to maintain. What do you think?

SarahFrench avatar Sep 12 '22 15:09 SarahFrench

Having an automated way to do this would be better but I think it's fine if you want to enhance the docs like this for now.

ScottSuarez avatar Sep 12 '22 17:09 ScottSuarez