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

Small improvements in Taskfile about protocol buffer generation #2793

Merged
merged 3 commits into from
Dec 23, 2024

Conversation

cmaglie
Copy link
Member

@cmaglie cmaglie commented Dec 23, 2024

Please check if the PR fulfills these requirements

See how to contribute

  • The PR has no duplicates (please search among the Pull Requests
    before creating one)
  • The PR follows
    our contributing guidelines
  • Tests for the changes have been added (for bug fixes / features)
  • Docs have been added / updated (for bug fixes / features)
  • UPGRADING.md has been updated with a migration guide (for breaking changes)
  • configuration.schema.json updated if new parameters are added.

What kind of change does this PR introduce?

Makes task protoc handle some common cases.

What is the current behavior?

  • task protoc fails if the buf format changes the formatting of the protoc files, since the other tasks are run in parallel the .proto files may be changed while being read by other processes:
    $ task protoc
    task: [protoc:breaking-change-detection] buf breaking --against '.git#branch=origin/master,subdir=rpc'
    task: [protoc:format] buf format --write --exit-code
    task: [protoc:check] buf lint
    task: [protoc:compile] buf dep update
    Failure: context canceled
    Failure: context canceled
    Failure: context canceled
    
  • task protoc:format fails if the buf format changes the formatting of the protoc files due to the --exit-code flag:
    $ task protoc:format
    task: [protoc:format] buf format --write --exit-code
    task: Failed to run task "protoc:format": exit status 100
    

What is the new behavior?

task protoc and task protoc:format works as expected.

Does this PR introduce a breaking change, and is titled accordingly?

No

Other information

Otherwise if the format task changes the underlying files, it will make
fail the other tasks.

  task: [protoc:breaking-change-detection] buf breaking --against '.git#branch=origin/master,subdir=rpc'
  task: [protoc:format] buf format --write --exit-code
  task: [protoc:check] buf lint
  task: [protoc:compile] buf dep update
  Failure: context canceled
  Failure: context canceled
  Failure: context canceled
  exit status 100
@cmaglie cmaglie self-assigned this Dec 23, 2024
@cmaglie cmaglie added topic: infrastructure Related to project infrastructure type: imperfection Perceived defect in any part of project labels Dec 23, 2024
Copy link

codecov bot commented Dec 23, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 67.59%. Comparing base (0a116e7) to head (f0c02d6).
Report is 1 commits behind head on master.

Additional details and impacted files
@@            Coverage Diff             @@
##           master    #2793      +/-   ##
==========================================
- Coverage   67.60%   67.59%   -0.02%     
==========================================
  Files         238      238              
  Lines       22374    22374              
==========================================
- Hits        15126    15123       -3     
- Misses       6060     6062       +2     
- Partials     1188     1189       +1     
Flag Coverage Δ
unit 67.59% <ø> (-0.02%) ⬇️

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.

@cmaglie cmaglie merged commit 7782c89 into arduino:master Dec 23, 2024
106 checks passed
@cmaglie cmaglie deleted the taskfile-improve branch December 23, 2024 11:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
topic: infrastructure Related to project infrastructure type: imperfection Perceived defect in any part of project
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants