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

DCA11Y-1145 Incremental yarn build execution #8

Open
wants to merge 8 commits into
base: master
Choose a base branch
from

Conversation

rafalsatl
Copy link
Collaborator

POC/in-flight support for incremental builds

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
@rafalsatl rafalsatl changed the title [DRAFT] Issue/master/none incremental yarn build execution [DRAFT] incremental yarn build execution Sep 20, 2024
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`
@rafalsatl rafalsatl force-pushed the issue/master/NONE-incremental-yarn-build-execution branch from 844bc4a to e532439 Compare September 20, 2024 13:41
@rafalsatl rafalsatl changed the title [DRAFT] incremental yarn build execution Incremental yarn build execution Sep 23, 2024
@rafalsatl rafalsatl changed the title Incremental yarn build execution DCA11Y-1145 Incremental yarn build execution Sep 23, 2024
if (incrementalHelper.shouldExecute()) {
File packageJson = new File(this.workingDirectory, "package.json");
if (this.buildContext == null || this.buildContext.hasDelta(packageJson)
|| !this.buildContext.isIncremental()) {
Copy link
Collaborator

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?

Copy link
Collaborator Author

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;
Copy link
Collaborator

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?

Copy link
Collaborator Author

@rafalsatl rafalsatl Sep 30, 2024

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");
Copy link
Collaborator

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?

Copy link
Collaborator Author

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? ;)

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.

2 participants