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

Fail to differentiate between multiple separate checks in same PR #51

Closed
arxeiss opened this issue Jul 18, 2024 · 3 comments · Fixed by #52
Closed

Fail to differentiate between multiple separate checks in same PR #51

arxeiss opened this issue Jul 18, 2024 · 3 comments · Fixed by #52

Comments

@arxeiss
Copy link

arxeiss commented Jul 18, 2024

Hello,

I'm trying to migrate from separate actions you provided earlier into this all-in-one action.
But I have spotted an issue with our 2 buf modules. We have proto/public and proto/internal folders so I have 2 Github actions. See example of action yaml below. We trigger that action only when there is a change inside specific folder.

Reason we have 2 separate actions is breaking check. For public, we cannot do breaking change (except rare case) but for internal, we can. As we deploy all together (not best approach, but for now it speeds up development), so we are OK with small risk.

However, your action in the first run created 2 comments with same wording. So it is not possible to differentiate between them.

And during second round, action modified just 1 comment, and the second was left unchanged.

Do you plan to support multiple buf-action runs within same PR?

Thank you

Same file we have twice, once with proto/public and second with proto/internal.

---
name: buf check
on:
    pull_request:
        types: [opened, synchronize, reopened, ready_for_review]
        branches: master
        paths:
            - proto/public/**

permissions:
    contents: read
    pull-requests: write

jobs:
    build:
        name: Perform a buf check
        runs-on: ubuntu-latest
        steps:
            - name: Checkout codebase
              uses: actions/checkout@v4

            - name: buf setup
              uses: bufbuild/[email protected]
              with:
                  input: proto/public
                  breaking_against: https://github.com/${{github.repository}}.git#branch=master,subdir=proto/public

image

@emcfarlane
Copy link
Collaborator

emcfarlane commented Jul 18, 2024

Hey @arxeiss, the action doesn't currently support multiple runs updating the comment. I'll have a look at adding a fix to better support this usecase. For now you can disable comments with pr_comment: false or trigger only certain proto files or only run checks in certain directories avoiding duplicates.

pull_request:
    paths:
        proto/public

Thanks for reporting.

@emcfarlane
Copy link
Collaborator

@arxeiss would you be able to validate the solution in #52 solves your use case? You may use that action as: - uses: bufbuild/buf-action@ed/multiComments to test.

@arxeiss
Copy link
Author

arxeiss commented Jul 19, 2024

Seems it is working fine. Thanks

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 a pull request may close this issue.

2 participants