Skip to content
This repository was archived by the owner on Jan 8, 2025. It is now read-only.

Lint alignment of components with forScopes#327

Closed
ptgott wants to merge 1 commit intomainfrom
paul.gottschling/2023-06-scope-linter
Closed

Lint alignment of components with forScopes#327
ptgott wants to merge 1 commit intomainfrom
paul.gottschling/2023-06-scope-linter

Conversation

@ptgott
Copy link
Copy Markdown
Contributor

@ptgott ptgott commented Jun 26, 2023

The forScopes field of a navigation entry in docs/config.json determines which scope switcher buttons appear on a docs page. If a scoped component supports a scope that does not appear in the switcher, the user can only adjust the visibility of the component using the scope query string.

Further, if a Tabs component includes some scopes but not all of the ones listed in a page's forScopes, it's likely that the page's forScopes setting is misconfigured.

This change adds a linter that checks whether:

  • A page's scoped components include any scopes that are not listed in forScopes.
  • Tabs components that include at least one scope in the forScopes configuration also include the remaining scopes. The linter only performs this check for Tabs components since it's the only component that we expect to always include all scopes within a set.

This change will make it easier to incorporate Teleport Team instructions into the docs, since we can configure the linter to check for the team scope in scoped Tabs components and ensure that the forScopes setting is configured correctly.

@vercel
Copy link
Copy Markdown

vercel Bot commented Jun 26, 2023

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
docs ✅ Ready (Inspect) Visit Preview 💬 Add feedback Jul 10, 2023 1:56pm

@ptgott ptgott marked this pull request as draft June 26, 2023 22:11
@ptgott
Copy link
Copy Markdown
Contributor Author

ptgott commented Jun 26, 2023

Converting to draft until I fix the yarn typecheck/compilation issues

@ptgott ptgott force-pushed the paul.gottschling/2023-06-scope-linter branch from 5d80130 to 2c533d3 Compare June 27, 2023 15:12
@ptgott ptgott force-pushed the paul.gottschling/2023-06-scope-linter branch from 2c533d3 to 249e366 Compare June 28, 2023 19:19
@ptgott ptgott force-pushed the paul.gottschling/2023-06-scope-linter branch from 249e366 to 2fadfac Compare June 28, 2023 19:28
@ptgott ptgott marked this pull request as ready for review June 28, 2023 19:47
ptgott added a commit to gravitational/teleport that referenced this pull request Jun 30, 2023
Closes #26500

This change requires merging gravitational/docs#326 to add a Team scope
to the docs.

This updates pages within the docs so that:

- Each page's `forScopes` configuration is accurate, especially with
  regard to support for Teleport Team.
- All scoped components match the `forScopes` configuration for each
  page. For this, I used the linter introduced by
  gravitational/docs#327.
@ptgott ptgott force-pushed the paul.gottschling/2023-06-scope-linter branch from 2fadfac to c9a02ed Compare June 30, 2023 19:21
ptgott added a commit to gravitational/teleport that referenced this pull request Jul 5, 2023
Closes #26500

This change requires merging gravitational/docs#326 to add a Team scope
to the docs.

This updates pages within the docs so that:

- Each page's `forScopes` configuration is accurate, especially with
  regard to support for Teleport Team.
- All scoped components match the `forScopes` configuration for each
  page. For this, I used the linter introduced by
  gravitational/docs#327.
github-merge-queue Bot pushed a commit to gravitational/teleport that referenced this pull request Jul 5, 2023
* Edit forScopes configurations and edit guides

Closes #26500

This change requires merging gravitational/docs#326 to add a Team scope
to the docs.

This updates pages within the docs so that:

- Each page's `forScopes` configuration is accurate, especially with
  regard to support for Teleport Team.
- All scoped components match the `forScopes` configuration for each
  page. For this, I used the linter introduced by
  gravitational/docs#327.

* Respond to alexfornuto feedback
@ptgott ptgott requested a review from zmb3 July 6, 2023 21:30
ptgott added a commit to gravitational/teleport that referenced this pull request Jul 7, 2023
Backports #28443

* Edit forScopes configurations and edit guides

Closes #26500

This change requires merging gravitational/docs#326 to add a Team scope
to the docs.

This updates pages within the docs so that:

- Each page's `forScopes` configuration is accurate, especially with
  regard to support for Teleport Team.
- All scoped components match the `forScopes` configuration for each
  page. For this, I used the linter introduced by
  gravitational/docs#327.

* Respond to alexfornuto feedback
@ptgott ptgott force-pushed the paul.gottschling/2023-06-scope-linter branch from c9a02ed to e818699 Compare July 10, 2023 13:11
ptgott added a commit to gravitational/teleport that referenced this pull request Jul 10, 2023
Backports #28443

* Edit forScopes configurations and edit guides

Closes #26500

This change requires merging gravitational/docs#326 to add a Team scope
to the docs.

This updates pages within the docs so that:

- Each page's `forScopes` configuration is accurate, especially with
  regard to support for Teleport Team.
- All scoped components match the `forScopes` configuration for each
  page. For this, I used the linter introduced by
  gravitational/docs#327.

* Respond to alexfornuto feedback
The `forScopes` field of a navigation entry in `docs/config.json`
determines which scope switcher buttons appear on a docs page. If a
scoped component supports a scope that does not appear in the switcher,
the user can only adjust the visibility of the component using the
`scope` query string.

Further, if a `Tabs` component includes some scopes but not all of the
ones listed in a page's `forScopes`, it's likely that the page's
`forScopes` setting is misconfigured.

This change adds a linter that checks whether:

- A page's scoped components include any scopes that are _not_ listed in
  `forScopes`.
- `Tabs` components that include at least one scope in the `forScopes`
  configuration _also_ include the remaining scopes. The linter only
  performs this check for `Tabs` components since it's the only
  component that we expect to always include all scopes within a set.

This change will make it easier to incorporate Teleport Team
instructions into the docs, since we can configure the linter to check
for the `team` scope in scoped `Tabs` components and ensure that the
`forScopes` setting is configured correctly.
@ptgott ptgott force-pushed the paul.gottschling/2023-06-scope-linter branch from e818699 to 12c5a84 Compare July 10, 2023 13:45
ptgott added a commit to gravitational/teleport that referenced this pull request Jul 10, 2023
Backports #28443

* Edit forScopes configurations and edit guides

Closes #26500

This change requires merging gravitational/docs#326 to add a Team scope
to the docs.

This updates pages within the docs so that:

- Each page's `forScopes` configuration is accurate, especially with
  regard to support for Teleport Team.
- All scoped components match the `forScopes` configuration for each
  page. For this, I used the linter introduced by
  gravitational/docs#327.

* Respond to alexfornuto feedback
ravicious pushed a commit to gravitational/teleport that referenced this pull request Jul 11, 2023
* Edit forScopes configurations and edit guides

Closes #26500

This change requires merging gravitational/docs#326 to add a Team scope
to the docs.

This updates pages within the docs so that:

- Each page's `forScopes` configuration is accurate, especially with
  regard to support for Teleport Team.
- All scoped components match the `forScopes` configuration for each
  page. For this, I used the linter introduced by
  gravitational/docs#327.

* Respond to alexfornuto feedback
Copy link
Copy Markdown
Contributor

@benarent benarent left a comment

Choose a reason for hiding this comment

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

It looks like the forScopes is the reason for #330 failing to pass, I manually removed team scopes from the 14 submodule and was able to build locally.

ptgott added a commit to gravitational/teleport that referenced this pull request Jul 13, 2023
Backports #28443

* Edit forScopes configurations and edit guides

Closes #26500

This change requires merging gravitational/docs#326 to add a Team scope
to the docs.

This updates pages within the docs so that:

- Each page's `forScopes` configuration is accurate, especially with
  regard to support for Teleport Team.
- All scoped components match the `forScopes` configuration for each
  page. For this, I used the linter introduced by
  gravitational/docs#327.

* Respond to alexfornuto feedback
ptgott added a commit to gravitational/teleport that referenced this pull request Jul 13, 2023
Backports #28443

* Edit forScopes configurations and edit guides

Closes #26500

This change requires merging gravitational/docs#326 to add a Team scope
to the docs.

This updates pages within the docs so that:

- Each page's `forScopes` configuration is accurate, especially with
  regard to support for Teleport Team.
- All scoped components match the `forScopes` configuration for each
  page. For this, I used the linter introduced by
  gravitational/docs#327.

* Respond to alexfornuto feedback
github-merge-queue Bot pushed a commit to gravitational/teleport that referenced this pull request Jul 13, 2023
Backports #28443

* Edit forScopes configurations and edit guides

Closes #26500

This change requires merging gravitational/docs#326 to add a Team scope
to the docs.

This updates pages within the docs so that:

- Each page's `forScopes` configuration is accurate, especially with
  regard to support for Teleport Team.
- All scoped components match the `forScopes` configuration for each
  page. For this, I used the linter introduced by
  gravitational/docs#327.

* Respond to alexfornuto feedback
github-merge-queue Bot pushed a commit to gravitational/teleport that referenced this pull request Jul 14, 2023
Backports #28443

* Edit forScopes configurations and edit guides

Closes #26500

This change requires merging gravitational/docs#326 to add a Team scope
to the docs.

This updates pages within the docs so that:

- Each page's `forScopes` configuration is accurate, especially with
  regard to support for Teleport Team.
- All scoped components match the `forScopes` configuration for each
  page. For this, I used the linter introduced by
  gravitational/docs#327.

* Respond to alexfornuto feedback
@ptgott
Copy link
Copy Markdown
Contributor Author

ptgott commented Jul 26, 2023

Note: we should wait until v14 is out before we merge this. Doing so will simplify the process of getting this linter to pass, since v11 of the docs don't support Teleport Team.

@ptgott
Copy link
Copy Markdown
Contributor Author

ptgott commented Sep 5, 2023

Closing because we are removing the scoped visibility functionality from the docs (#383).

@ptgott ptgott closed this Sep 5, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants