Skip to content

ci: add group for core docs to pullapprove - #40225

Closed
jessicajaniuk wants to merge 2 commits into
angular:masterfrom
jessicajaniuk:core-docs-pullapprove
Closed

jessicajaniuk wants to merge 2 commits into
angular:masterfrom
jessicajaniuk:core-docs-pullapprove

Conversation

@jessicajaniuk

Copy link
Copy Markdown
Contributor

This adds a second pullapprove group to just include the aio content for core.
It ensures that the comp: docs label gets applied properly

PR Checklist

Please check if your PR fulfills the following requirements:

PR Type

What kind of change does this PR introduce?

  • Bugfix
  • Feature
  • Code style update (formatting, local variables)
  • Refactoring (no functional changes, no api changes)
  • Build related changes
  • CI related changes
  • Documentation content changes
  • angular.io application / infrastructure changes
  • Other... Please describe:

What is the current behavior?

Any docs content in the angular.io code will not have core: docs applied to it properly.
PullApprove auto removes the core: docs if it's manually added, since paths don't line up
to any docs config.

Issue Number: N/A

What is the new behavior?

Core will have its own docs config, and the docs label will be automatically added by PullApprove
going forward for any aio content added matching core paths.

Does this PR introduce a breaking change?

  • Yes
  • No

Other information

@google-cla google-cla Bot added the cla: yes label Dec 21, 2020
@pullapprove pullapprove Bot added the area: build & ci Related the build and CI infrastructure of the project label Dec 21, 2020
@ngbot ngbot Bot added this to the Backlog milestone Dec 21, 2020
@jessicajaniuk jessicajaniuk added the target: patch This PR is targeted for the next patch release label Dec 21, 2020

@gkalpak gkalpak left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

I am a little confused:

  • What aboud groups other than core?
  • Shouldn't the files be part of one group only? (Currently they are part of both fw-core and docs-core. Is that intentional? How does PullApprove handle that?)

@jessicajaniuk

jessicajaniuk commented Dec 21, 2020 •

Copy link
Copy Markdown
Contributor Author

I am a little confused:

  • What aboud groups other than core?
  • Shouldn't the files be part of one group only? (Currently they are part of both fw-core and docs-core. Is that intentional? How does PullApprove handle that?)

Initially I thought exactly like you, @gkalpak. I thought there'd be one config for comp: docs, but there's actually a number of docs config blocks in this config. You'll find docs-getting-started-and-tutorial, docs-marketing, docs-observables, docs-packaging-and-releasing, docs-cli, docs-libraries, docs-schematics, docs-infra, and this would add docs-core to ensure those paths are appropriately labeled. Each of those groups tackles different blocks of the docs paths for various reasons. Some require different approvers. Some have different labels. So it doesn't quite make sense to put them in one docs block. And we can't leave it in the fw-core by itself and also apply comp: docs, because there's more than just docs there. So it requires a separate docs only group for core content.

@jessicajaniuk

Copy link
Copy Markdown
Contributor Author

Also to answer your question of how does PullApprove handle that, in the case that a code path exists in two groups, both configs apply. So it applies both labels. We have this situation already in a couple of our PullApprove group configs here. We could remove the aio content from fw-core and only include it in docs-core, but then it wouldn't get the comp: core label unless we applied it as well in the docs-core group. I'm not sure if the auto label config section support multiple labels or just one. So I'd have to test that.

@gkalpak

gkalpak commented Dec 21, 2020

Copy link
Copy Markdown
Member

Initially I thought exactly like you, @gkalpak. I thought there'd be one config for comp: docs, but there's actually a number of docs config blocks in this config.

Yes, I know that there are multiple blocks containing docs-related files 馃榿

Currently, we distinguish docs into two main categories: API docs and non-API docs (i.e. guides, tutorials, marketing pages, etc.)
API docs are extracted from JSDoc comments inside the source code files, so the files that affect API docs belong to a specific package (e.g. packages/core/**, packages/forms/**, etc.).
Non-API docs live in aio/content/** and they include content (i.e. HTML or Markdown files, images) and examples (which are mini-apps from which we extract code snippets to show in the docs).

The way we have these different types of docs assigned to groups currently is this:

  • The files that contain API docs are essentially the same files that contain the source code for a package, so they are assigned to the corresponding "package" group (for example, fw-core, fw-common, fw-router, etc.).
  • The non-API docs that are related to a specific package, are also assigned to the corresponding "package" group. For example a guide on routing is assigned to fw-router, a docs example for forms is assigned to fw-forms, etc.
  • The rest of the non-API docs (that are broader and do not correspond to a specific package) are assigned to different subcategories, such as docs-marketing (for marketing pages content), docs-observables (for guides related to observables), etc.

So, what this PR currently does is create a new group (docs-core) for the non-API docs that are related to the core package (or some more generic docs that are also assigned to the core package due to being related to "core" Angular concepts). If anything, I would expect this PR to include similar groups for the non-API docs that are related to the rest of the Angular framework packages, for example:

  • fw-forms --> docs-forms
  • fw-router --> docs-router
  • fw-service-worker --> docs-service-worker
  • ...etc.

(That was my first question.)

in the case that a code path exists in two groups, both configs apply.

馃帀

I'm not sure if the auto label config section support multiple labels or just one. So I'd have to test that.

I think this is worth investigating. It would be better if we could keep files in one group. For example, if we want to add a new guide in the future, we would only need to add it in one place to get the correct labels. By referencing the files in two groups (e.g. fw-core and docs-core), we would have to remember to add them to (and remove them from) both groups.


To summarize, I think breaking up the "package" groups (core, forms, router, etc.) into separate groups for source code (fw-*) and non-API docs (docs-*) is definitely an improvement over the current situation (but it should be done for all packages to remain consistent).

If possible, it would be preferable imo to only reference files in one group (instead of having them in both fw-* and docs-*). By looking at the docs, this is likely not supported by PullApprove, though 馃槥

Comment thread .pullapprove.yml Outdated

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

I think it is worth adding a note at the top of the file (maybe under configuration nuances) mentioning that we should ensure that fw-* and docs-* groups always have the same reviewers.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

I've added a comment to each block that has a matching docs-* section and also the same comment to the docs section pointing back to the fw-* regarding keeping each section in sync. Let me know if that works for you.

@jessicajaniuk

Copy link
Copy Markdown
Contributor Author

I think this is worth investigating. It would be better if we could keep files in one group. For example, if we want to add a new guide in the future, we would only need to add it in one place to get the correct labels. By referencing the files in two groups (e.g. fw-core and docs-core), we would have to remember to add them to (and remove them from) both groups.

One group is just not possible for fw-core or any group that requires docs. The labeling system for PullApprove applies to the entire group and cannot conditionally apply labels to specific sub paths within that group. fw-core includes paths that are not docs. So in using only one singular group with multiple labels, all code within that group would get both comp: core and comp: docs, which is incorrect. Two groups for each block are required.


To summarize, I think breaking up the "package" groups (core, forms, router, etc.) into separate groups for source code (fw-) and non-API docs (docs-) is definitely an improvement over the current situation (but it should be done for all packages to remain consistent).

Yeah I was looking at that. I'm happy to create subsequent PRs for each of these blocks to ensure we have clear documentation of all of these section changes.

@jessicajaniuk jessicajaniuk left a comment

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

/pullapprove-test

version: 3
groups:
  code-ownership:
    conditions:
      - >
        contains_any_globs(files, [
          '.pullapprove.yml'
          ])
    labels:
      pending:
        - "comp: build & ci"
        - "comp: core"
      approved: "comp: build & ci"
      rejected: "comp: build & ci"
    reviewers:
      users:
        - jessicajaniuk

@pullapprove

pullapprove Bot commented Dec 21, 2020

Copy link
Copy Markdown

@jessicajaniuk

jessicajaniuk commented Dec 21, 2020 •

Copy link
Copy Markdown
Contributor Author

Verified that PullApprove does not support multiple labels at a time. So separate sections and duplication of paths are unfortunately required. Labels must be a single string.

@jessicajaniuk

Copy link
Copy Markdown
Contributor Author

I just added all the new sections as a separate commit to this PR. This should now cover all docs paths for every component we have.

@gkalpak gkalpak left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

A couple of minor comments (nothing blocking). Otherwise lgtm 馃殌

BTW, you could also add a comment in fw-compiler > users:

-      users:
+      users: # Keep list in sync with Docs: Compiler

Comment thread .pullapprove.yml Outdated
Comment thread .pullapprove.yml Outdated
Comment thread .pullapprove.yml Outdated
@gkalpak gkalpak added action: cleanup The PR is in need of cleanup, either due to needing a rebase or in response to comments from reviews action: review The PR is still awaiting reviews from at least one requested reviewer labels Dec 22, 2020
@jessicajaniuk jessicajaniuk removed the action: cleanup The PR is in need of cleanup, either due to needing a rebase or in response to comments from reviews label Dec 22, 2020
@gkalpak

gkalpak commented Dec 29, 2020

Copy link
Copy Markdown
Member

Possibly simpler alternative approach: #40273
(It remains to be determined if it works as intended.)

@atscott

atscott commented Dec 29, 2020

Copy link
Copy Markdown
Contributor

Possibly simpler alternative approach: #40273
(It remains to be determined if it works as intended.)

Oh, I hadn't realized there was already work being done here; I was just trying to fix the config for my PR that pullapprove removed comp: docs from.

I don't think reviewers is required - the docs have an example of a group that has no reviewers here
I was testing the config in #40272 and it seems to work nicely as long as we're okay with comp: docs for everything under the guide and examples folders.

@jessicajaniuk

Copy link
Copy Markdown
Contributor Author

I hadn't even thought of that! I'll remove all the reviewers blocks from the new sections. Thanks!

This adds a second pullapprove group to just include the aio content for core.
It ensures that the comp: docs label gets applied properly
@jessicajaniuk
jessicajaniuk force-pushed the core-docs-pullapprove branch from 5a11160 to b0ef5f1 Compare January 5, 2021 18:48
@jessicajaniuk

Copy link
Copy Markdown
Contributor Author

Closing this PR as we're going to rollback auto-labeling for now. I've got a design doc to discuss a better approach.

@angular-automatic-lock-bot

Copy link
Copy Markdown

This issue has been automatically locked due to inactivity.
Please file a new issue if you are encountering a similar or related problem.

Read more about our automatic conversation locking policy.

This action has been performed automatically by a bot.

@angular-automatic-lock-bot angular-automatic-lock-bot Bot locked and limited conversation to collaborators Feb 5, 2021
@jessicajaniuk
jessicajaniuk deleted the core-docs-pullapprove branch October 26, 2021 22:05
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

action: review The PR is still awaiting reviews from at least one requested reviewer area: build & ci Related the build and CI infrastructure of the project cla: yes target: patch This PR is targeted for the next patch release

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants