yarn.build icon indicating copy to clipboard operation
yarn.build copied to clipboard

yarn build --since <commithash>|<numberof commits> not building anything.

Open cmark1302 opened this issue 3 years ago • 3 comments

Describe the bug yarn build --since with commit hash or number of commits are not working

Also, it shouldn't build the dependencies. Instead it should do other way round (Let's say if package file got changed, then we should build whoever(apps) using the package

To Reproduce Steps to reproduce the behavior: yarn build --since | yarn build --since 2 [ Summary ]--------------------------------------------------------------------- Success: 0 Fail: 0 Skipped: 0 Up to date: 0 Total: 0

Runtime (wall): 0.01s [ build finished ]-------------------------------------------------------------- ➤ YN0000: Done in 0s 12ms

Expected behavior build should happen

Desktop (please complete the following information):

  • OS: macOS

cmark1302 avatar Aug 04 '22 19:08 cmark1302

@ojkelly

It started to partially work after adding --relative as an argument to git diff. However, building dependencies is still an issue

https://github.com/ojkelly/yarn.build/blob/main/packages/plugins/shared/src/changes.ts#L14 https://github.com/ojkelly/yarn.build/blob/main/packages/plugins/shared/src/changes.ts#L17

    if (options.commit) {
      cmd = `git diff --name-only --relative ..${options.commit}`;
    }
    if (options.sinceBranch && options.sinceBranch.length > 0) {
      cmd = `git diff --name-only --relative ${options.sinceBranch}...`;
    }

cmark1302 avatar Aug 05 '22 05:08 cmark1302

Do you think it would be valuable for you also to be able to do something like yarn build --diff $ where the result is just passed to git diff directly?

I'm also working on a cleaner and better tested approach to determining what to build, that is working to address this.

ojkelly avatar Aug 05 '22 09:08 ojkelly

Yes. that sounds good

cmark1302 avatar Aug 05 '22 16:08 cmark1302