-
Notifications
You must be signed in to change notification settings - Fork 1
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
DCA11Y-1145 Incremental yarn build execution #8
base: master
Are you sure you want to change the base?
DCA11Y-1145 Incremental yarn build execution #8
Conversation
Get a digest of all .js files in the working directory except within the target dir Define the next steps
…ssful build completion Print added, modified and removed files Refactor the code to make it readable and maintainable
Incremental build now activated with the execution `incremental` configuration flag set to `true`
Incremental build now activated with the execution `incremental` configuration flag set to `true`
844bc4a
to
e532439
Compare
if (incrementalHelper.shouldExecute()) { | ||
File packageJson = new File(this.workingDirectory, "package.json"); | ||
if (this.buildContext == null || this.buildContext.hasDelta(packageJson) | ||
|| !this.buildContext.isIncremental()) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do I understand this correctly?
- we initialize Incremental helper (L74)
- we ask it to check the project (L76)
- if it reports yes, we check whether the incremental builds are enabled in the build context (L79)
That seems illogical to me, as the incremental setting on the build should in my mental picture should have primacy over the incremental helper. What am I missing?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes - our helper has "priority" because we were not able to make the incremental setting on the build context to ever be true - any ideas how to achieve this are welcome (ie. in all my testing the buildcontext was the "default build context" that has a hard-coded implementation of all such methods combing down to "return false")
Please note the helper is explicitly enabled by the user in the pom.xml via the incremental flag so it's 100% clear what "happens" and that the build will run with these additional checks.
|
||
public boolean shouldExecute() { | ||
if (!isActive) { | ||
return true; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why should the incremental helper execute if it is not active?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The question the helper answers is "should the guarded feature execute or be skipped" so yes - if it's not active it responds "yes - please execute this time" :)
String prevDigest = readPreviousDigest(); | ||
|
||
if (currDigest.equals(prevDigest)) { | ||
getLog().info("Atlassian Fork FTW - No changes detected! - Skipping yarn build"); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can the user-visible message be more guarded in its enthusiasm?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It obviously can but would we want it to be given the incredible gains provided? ;)
POC/in-flight support for incremental builds