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(project): runTaskCommand() ignores projenCommand #3293

Merged
merged 2 commits into from
Jan 26, 2024

Conversation

mrgrain
Copy link
Contributor

@mrgrain mrgrain commented Jan 21, 2024

The existing implementation of runTaskCommand() on Project has a bug that is causing it ignore the value of projenCommand.

While looking at fixing this, I noticed a bunch of inconsistency in this area. For example NodeProject has its own implementation of runTaskCommand() and NodePackage has a custom projenCommand, which I deprecated. There's also some inconsistency of when projenCommand is used directly vs. when runTaskCommand() is used and both have a different default value.

I don't have time to sort out this mess right now, because both "easy fixes" have some wider implications:

  • Making npx projen@<version> the default for projenCommand feels safer, but would cause all generated files to update the header all the time
  • Using npx projen in runTaskCommand() seems less safe for languages that don't have the projen version locked in a lockfile.

Thus I have focused on fixing the bug at hand. This is a low hanging fruit albeit the implementation is a bit akward.


By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.

@mrgrain mrgrain changed the title fix(tasks): move runTaskCommand to Tasks component and deprecate other implementations fix(tasks): deprecate broken project.runTaskCommand(task) in favor of new project.tasks.runTaskCommand(task) Jan 21, 2024
@codecov-commenter
Copy link

codecov-commenter commented Jan 21, 2024

Codecov Report

Attention: 2 lines in your changes are missing coverage. Please review.

Comparison is base (8330327) 96.32% compared to head (805195e) 96.32%.

Files Patch % Lines
src/project.ts 77.77% 2 Missing ⚠️

❗ Your organization needs to install the Codecov GitHub app to enable full functionality.

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #3293   +/-   ##
=======================================
  Coverage   96.32%   96.32%           
=======================================
  Files         191      191           
  Lines       36488    36497    +9     
  Branches     3399     3400    +1     
=======================================
+ Hits        35147    35157   +10     
+ Misses       1341     1340    -1     

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

@mrgrain mrgrain force-pushed the mrgrain/fix/run-task-command-ignores-projen-command branch from 0e5d763 to 1f53e76 Compare January 21, 2024 17:25
@mrgrain mrgrain changed the title fix(tasks): deprecate broken project.runTaskCommand(task) in favor of new project.tasks.runTaskCommand(task) fix: runTaskCommand() ignores projenCommand Jan 22, 2024
@mrgrain mrgrain force-pushed the mrgrain/fix/run-task-command-ignores-projen-command branch from 1f53e76 to 470a67a Compare January 22, 2024 12:35
@mrgrain mrgrain changed the title fix: runTaskCommand() ignores projenCommand fix(project): runTaskCommand() ignores projenCommand Jan 26, 2024
@mergify mergify bot merged commit 7ffce3c into main Jan 26, 2024
16 checks passed
@mergify mergify bot deleted the mrgrain/fix/run-task-command-ignores-projen-command branch January 26, 2024 12:14
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 this pull request may close these issues.

None yet

3 participants