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 duplication of docs issues #8747

Merged
merged 2 commits into from
Sep 29, 2023
Merged

fix duplication of docs issues #8747

merged 2 commits into from
Sep 29, 2023

Conversation

emmyoop
Copy link
Member

@emmyoop emmyoop commented Sep 29, 2023

resolves #8746

Problem

Workflow has double generated issues in the other repo

Solution

Ensure the label added in the labeled event is user docs and only run if that's true or the PR is in a merged state with the correct label.

Checklist

  • I have read the contributing guide and understand what's expected of me
  • I have run this code in development and it appears to resolve the stated issue
  • This PR includes tests, or tests are not required/relevant for this PR
  • This PR has no interface changes (e.g. macros, cli, logs, json artifacts, config files, adapter interface, etc) or this PR has already received feedback and approval from Product or DX
  • This PR includes type annotations for new and modified functions

@emmyoop emmyoop added the Skip Changelog Skips GHA to check for changelog file label Sep 29, 2023
@emmyoop emmyoop requested a review from a team as a code owner September 29, 2023 13:59
@emmyoop emmyoop requested review from aranke and VersusFacit and removed request for a team September 29, 2023 13:59
@cla-bot cla-bot bot added the cla:yes label Sep 29, 2023
@codecov
Copy link

codecov bot commented Sep 29, 2023

Codecov Report

All modified lines are covered by tests ✅

Comparison is base (408a789) 86.65% compared to head (f3872b2) 86.65%.

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #8747   +/-   ##
=======================================
  Coverage   86.65%   86.65%           
=======================================
  Files         176      176           
  Lines       25772    25772           
=======================================
  Hits        22332    22332           
  Misses       3440     3440           
Flag Coverage Δ
integration 83.41% <ø> (ø)
unit 65.13% <ø> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

Copy link
Member

@aranke aranke left a comment

Choose a reason for hiding this comment

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

If GitHub passes in these two events in order that:

  1. Triggers the labeled if/else branch
  2. Triggers the closed if/else branch,
    then two docs issues will be created?

Can we change this logic to check for a docs issue instead, and only create one if it doesn't exist?

@emmyoop
Copy link
Member Author

emmyoop commented Sep 29, 2023

Can we change this logic to check for a docs issue instead, and only create one if it doesn't exist?

We can't because we don't know what the issue is. The main action flow is:

  1. Check if a templated comment exists on the PR
  2. If the Comment does not exist open an issue in the designated repo
  3. Leave the templated comment on the PR with a link to the newly opened issue

So that takes care of most cases where this is a problem. The reason it generated 2 issues on a PR was because we merged the PR and immediately added a backport label. It triggered this twice (for both closed and labeled) and they ran so close together that neither left the comment before the other checked for a comment. This fix would prevent the labeled trigger from running calling the workflow.

This fix doesn't solve for the case of someone merging a PR and specifically adding the user docs label immediately but I'm not sure there's much we can do about that based on how this kind of state exists in GitHub and wanting the flexibility to be able to add the label before or after a PR is merged. The user docs label is also not generally a label we wait to add until the last second. The backport labels are since they don't trigger when you add them before merge.

Copy link
Member

@aranke aranke left a comment

Choose a reason for hiding this comment

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

Makes sense to me, LGTM!

@emmyoop emmyoop merged commit 416bc84 into main Sep 29, 2023
50 checks passed
@emmyoop emmyoop deleted the er/fix-docs-label-issues branch September 29, 2023 14:40
QMalcolm pushed a commit that referenced this pull request Oct 9, 2023
* fix duplication of docs issues

* update conditional to only run on merged PRs
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
cla:yes Skip Changelog Skips GHA to check for changelog file
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[CT-3171] [Bug] user docs autogenerated issues sometimes are duplicated
2 participants