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

fix(clover): fix doc links for nested props #5508

Merged
merged 1 commit into from
Feb 20, 2025
Merged

Conversation

jkeiser
Copy link
Contributor

@jkeiser jkeiser commented Feb 19, 2025

This fixes the doc links we create for props that are part of nested definitions. In Cloud Formation, nested object definitions are placed in their own pages.

We had code trying to make this work, but it relied on $ref, which is stripped from most props during dereferencing. This code populates a "defName" into every prop with the name of its containing definition before the dereferencing happens.

Testing

  • Diffed output, verified that only docLink changed
  • Spot checked modified docLink, verified that old link failed and new link succeeded

Copy link

github-actions bot commented Feb 19, 2025

Dependency Review

✅ No vulnerabilities or OpenSSF Scorecard issues found.

OpenSSF Scorecard

PackageVersionScoreDetails

Scanned Files

@jkeiser jkeiser force-pushed the jkeiser/fix-doc-refs branch from 9f2c23d to 292b603 Compare February 19, 2025 17:42
@jkeiser jkeiser changed the base branch from clover/remove-impossible-actions to main February 19, 2025 17:42
@@ -576,6 +576,7 @@ export type DefaultPropType = "domain" | "secrets" | "resource_value";
export function createObjectProp(
name: string,
parentPath: string[],
cfProp: CfObjectProperty | undefined,
Copy link
Contributor

Choose a reason for hiding this comment

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

What's the advantage of declaring cfProp this way instead of cfProp?: CfObjectProperty?

Copy link
Contributor Author

@jkeiser jkeiser Feb 19, 2025

Choose a reason for hiding this comment

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

Oh, I did it this way so that typescript would yell at me anywhere I tried to call createObjectProp() without a cfProp argument--it forced me to make a decision in each place we create an object prop. It's not as necessary now that that initial turn is done, but doesn't hurt to show the explicit decision in the code IMO.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

i.e. if you don't use ?, then you can pass undefined but you can't omit the parameter.

vbustamante
vbustamante previously approved these changes Feb 20, 2025
sprutton1
sprutton1 previously approved these changes Feb 20, 2025
@jkeiser jkeiser dismissed stale reviews from sprutton1 and vbustamante via 2282328 February 20, 2025 18:24
@jkeiser jkeiser force-pushed the jkeiser/fix-doc-refs branch from 292b603 to 2282328 Compare February 20, 2025 18:24
@jkeiser jkeiser added this pull request to the merge queue Feb 20, 2025
Merged via the queue into main with commit 5b73980 Feb 20, 2025
8 checks passed
@jkeiser jkeiser deleted the jkeiser/fix-doc-refs branch February 20, 2025 18:38
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.

3 participants