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

pcs.Repo.def get_version_from_git() should not care about branches #374

Open
andyk opened this issue Apr 21, 2022 · 0 comments
Open

pcs.Repo.def get_version_from_git() should not care about branches #374

andyk opened this issue Apr 21, 2022 · 0 comments

Comments

@andyk
Copy link
Contributor

andyk commented Apr 21, 2022

Currently pcs.Repo.def get_version_from_git() will check if the local cached repo's branch is at the same commit as the same named branch on its remote repo.

This doesn't make sense when we check-out a specific githash of a remote and thus have a floating HEAD and not remote branch name.

agentos/pcs/repo.py

Lines 135 to 154 in 9e4428b

def get_version_from_git(
self,
component_identifier: ComponentIdentifier,
file_path: str,
force: bool = False,
) -> Tuple[str, str]:
"""
Given a path to a Component, this returns a git hash and GitHub repo
URL where the current version of the Component is publicly accessible.
This will raise an exception if any of the following checks are true:
1. The Component is not in a git repo.
2. The origin of this repo is not GitHub.
3. The current local branch and corresponding remote branch are not at
the same commit.
4. There are uncommitted changes locally
If ''force'' is True, checks 2, 3, and 4 above are ignored.
"""

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

No branches or pull requests

1 participant