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

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

Open
cmark1302 opened this issue Aug 4, 2022 · 3 comments
Assignees
Labels
bug Something isn't working

Comments

@cmark1302
Copy link

cmark1302 commented Aug 4, 2022

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 cmark1302 added the bug Something isn't working label Aug 4, 2022
@cmark1302 cmark1302 changed the title yarn build --since <commithash>|<numberof commits> not building anything yarn build --since <commithash>|<numberof commits> not building anything. Aug 4, 2022
@ojkelly ojkelly self-assigned this Aug 5, 2022
@cmark1302
Copy link
Author

cmark1302 commented Aug 5, 2022

@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}...`;
    }

@ojkelly
Copy link
Owner

ojkelly commented Aug 5, 2022

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.

@cmark1302
Copy link
Author

cmark1302 commented Aug 5, 2022

Yes. that sounds good

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants