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

Local best cli runs on master but no other branches for lwc-example #223

Open
manuel-jasso opened this issue Jun 9, 2020 · 8 comments
Open
Labels

Comments

@manuel-jasso
Copy link

Summary

I first identified this problem in the Locker repo, but I was able to reproduce it in the Best repo itself.

After checking out the Best repo and building, I did cd packages/lwc-example and ran yarn start and the tests ran fine. The current branch was master.

But when I created a branch foo (from master) and switched, running yarn start yields:

Looking for Best configurations...fatal: No remote configured to list refs from.

[WARN] - Unable to get git information

  ERROR     Error: Unable to read git information
    at generateProjectConfigs (/Users/manuel.jasso/dev/github/best/packages/@best/config/build/index.js:16:19)
    at readConfig (/Users/manuel.jasso/dev/github/best/packages/@best/config/build/index.js:76:45)
    at processTicksAndRejections (internal/process/task_queues.js:97:5)

Simply switching back to master and running yarn start again, the tests run fine.

This seems to be related to #184

Versions

  • node: 12.16.1
  • best: 4.0.0-beta5
@manuel-jasso
Copy link
Author

Update: it looks like the name of the local branch doesn't matter, I changed my foo branch to track github/master and then yarn start worked fine! 🤷🏻‍♂️

This is my setup:

manuel.jasso@manueljasso-ltm ~/dev/github/best/packages/lwc-example (foo)
$ git branch -vv
* foo    0c1ef01 [github/master] feat: rewrite of Agents, Hubs, Remotes and Algo (#217)
  master 0c1ef01 [github/master] feat: rewrite of Agents, Hubs, Remotes and Algo (#217)

So best cli fails unless the current branch is tracking master on the remote.

@jasonsilberman
Copy link
Contributor

I can't seem to reproduce this, when I try to run the lwc-example benchmarks it works fine.

I tried both in master and in a brand new branch that i just created, both worked fine.

Could there be something weird in your git config or setup? It seems that Best cannot read your git configurations properly.

@manuel-jasso
Copy link
Author

I tried a fresh checkout of best repo and the condition is that the current branch has to be tracking something that is not [origin/master], this is my fresh setup (do this while on master):

git branch --track bad
git branch good
git branch -vv
  bad    0c1ef01 [master] feat: rewrite of Agents, Hubs, Remotes and Algo (#217)
* good   0c1ef01 feat: rewrite of Agents, Hubs, Remotes and Algo (#217)
  master 0c1ef01 [origin/master] feat: rewrite of Agents, Hubs, Remotes and Algo (#217)

best runs fine on branch good (which tracks nothing) and branch master (which tracks [origin/master]) but fails on branch bad (which tracks [master])

@manuel-jasso
Copy link
Author

But given the conditions, this is a low priority issue because there is a workaround.

@jasonsilberman
Copy link
Contributor

Are you saying that the issue only happens when you have multiple local branches pointing to the same remote master?

@manuel-jasso
Copy link
Author

Mh, no, even one branch causes the error, I just pulled new master from best and these are the simplest repro steps I was able to come up with:

Do this while on master (after a fresh build):

git branch --track bad
git checkout bad
cd packages/lwc-example/
yarn start

This yields

Looking for Best configurations...[WARN] - Unable to get git information

  ERROR     Error: Unable to read git information
    at generateProjectConfigs (/Users/manuel.jasso/dev/github/best/packages/@best/config/build/index.js:17:19)
    at readConfig (/Users/manuel.jasso/dev/github/best/packages/@best/config/build/index.js:77:45)
    at processTicksAndRejections (internal/process/task_queues.js:97:5)

@jasonsilberman
Copy link
Contributor

I was able to reproduce as well. I think I am understanding this better now.

So this is happening when you create a local branch that tracks another local branch.

I am un-aware if this is very common behavior or not, as I have never needed to do this. I will see what I can do to figure out a fix though.

@manuel-jasso
Copy link
Author

Thanks, I know tracking a local branch makes no sense, this was just my simplest repro steps, I saw this error without tracking a local branch but I don't remember what I did, my hope is that the scenario will help you identify a problem which is not specific or related to tracking local branches. And like I said before, there is a workaround so this is not a high priority.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants