-
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
fix: Default branch doesn't show environments #65
base: main
Are you sure you want to change the base?
Conversation
Show environments without branch when the current branch is the default branch
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.
LGTM left some comments and would like to see some before and after screen shots
fix tests
…ranch-doesn't-show-environments
Get cannot find environments error message from errors
const calls = showErrorMessageSpy.mock.calls.filter( | ||
(call) => | ||
!( | ||
call[0].startsWith(cannotGetDefaultBranchMessage) || | ||
call[0].startsWith(getDefaultBranchErrorMessage) | ||
) | ||
); |
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.
what errors? I don't understand this one
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.
Since the simple-git library is imported into the code before the test files load, making it impossible to mock, I am encountering error messages in the tests for getting the default branch. Therefore, I need to ignore the cannotGetDefaultBranchMessage and getDefaultBranchErrorMessage messages.
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.
Wdym by its loaded before the test file? how is it different from other libs?
return undefined; | ||
} | ||
|
||
const remoteShowOrigin: string = await git.raw([ |
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.
what does remoteShowOrigin mean?
I don't really understand how this functions works, can you explain?
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.
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.
I see, so the var name is a little misleading, can't it just be default branch? ( or maybe repo default branch )
return { | ||
repository: normalizedRepositoryName, | ||
currentBranch, | ||
isDefaultBranch, |
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 is this part of this function? 🤔
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 not 🤷🏻♂️
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.
If its always used when this func is used then its fine imo ( but if its sometimes needed and sometimes it doesn't id remove it to its own func, because it doesn't really depend on anything here )
…ranch-doesn't-show-environments
problem:
Default branch doesn't show environments
Solution:
show env0 environments without blueprintRevision when current branch is the default branch
used git-simple to get the default branch
updated readme and errors accordingly
before:
after:
after when no envs to display