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

Separate freezing components from publishing them #388

Open
andyk opened this issue May 2, 2022 · 0 comments
Open

Separate freezing components from publishing them #388

andyk opened this issue May 2, 2022 · 0 comments

Comments

@andyk
Copy link
Contributor

andyk commented May 2, 2022

Currently agentos freeze and Component.to_versioned_component() with fail if the Component's repo is a GithubRepo and the local HEAD is different than the github remote HEAD. It prints an error (as shown below).

We should wait to check if the local git HEAD exists in the github remote until we try to publish, instead of checking when we do the freeze.

Traceback (most recent call last):
  File "/opt/homebrew/Caskroom/miniforge/base/envs/agentos_dev2/bin/agentos", line 33, in <module>
    sys.exit(load_entry_point('agentos', 'console_scripts', 'agentos')())
  File "/opt/homebrew/Caskroom/miniforge/base/envs/agentos_dev2/lib/python3.9/site-packages/click/core.py", line 1137, in __call__
    return self.main(*args, **kwargs)
  File "/opt/homebrew/Caskroom/miniforge/base/envs/agentos_dev2/lib/python3.9/site-packages/click/core.py", line 1062, in main
    rv = self.invoke(ctx)
  File "/opt/homebrew/Caskroom/miniforge/base/envs/agentos_dev2/lib/python3.9/site-packages/click/core.py", line 1668, in invoke
    return _process_result(sub_ctx.command.invoke(sub_ctx))
  File "/opt/homebrew/Caskroom/miniforge/base/envs/agentos_dev2/lib/python3.9/site-packages/click/core.py", line 1404, in invoke
    return ctx.invoke(self.callback, **ctx.params)
  File "/opt/homebrew/Caskroom/miniforge/base/envs/agentos_dev2/lib/python3.9/site-packages/click/core.py", line 763, in invoke
    return __callback(*args, **kwargs)
  File "/Users/andyk/Development/agentos/agentos/cli.py", line 258, in freeze
    frozen_reg = component.to_frozen_registry(force=force)
  File "/Users/andyk/Development/agentos/pcs/component.py", line 615, in to_frozen_registry
    versioned = self.to_versioned_component(force)
  File "/Users/andyk/Development/agentos/pcs/component.py", line 495, in to_versioned_component
    repo_url, version = self.repo.get_version_from_git(
  File "/Users/andyk/Development/agentos/pcs/repo.py", line 150, in get_version_from_git
    return self.GIT.get_public_url_and_hash(full_path, force)
  File "/Users/andyk/Development/agentos/pcs/git_manager.py", line 59, in get_public_url_and_hash
    curr_head_hash = self._check_remote_branch_status(
  File "/Users/andyk/Development/agentos/pcs/git_manager.py", line 194, in _check_remote_branch_status
    raise BadGitStateException(error_msg)
pcs.exceptions.BadGitStateException: Current head hash 845a553739b7805c2a7df2f7145fd30a076b7b3a in PCS repo <Repo at '/Users/andyk/Development/agentos'> is not on remote [email protected]:andyk/agentos.git. Push your changes to your remote!
@andyk andyk moved this to Todo in Sprint 0.2.1 May 3, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: Todo
Development

No branches or pull requests

1 participant