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

Enable updates on GitHub-based dependencies #102

Closed
5 tasks done
digorithm opened this issue Jun 30, 2021 · 2 comments · Fixed by #122
Closed
5 tasks done

Enable updates on GitHub-based dependencies #102

digorithm opened this issue Jun 30, 2021 · 2 comments · Fixed by #122
Assignees
Labels
enhancement New feature or request forc

Comments

@digorithm
Copy link
Member

digorithm commented Jun 30, 2021

Problem

Forc now allows users to specify remote dependencies hosted on GitHub (#101), however, once a dependency at a given reference (either default, branch, or tag) has been downloaded, there's no way to check if there are newer updates to it (i.e fresher commits on top of a reference) and actually perform the updates.

Proposal

Add another command to Forc's CLI, update, that will check for updates on the dependencies in Forc.toml that have git set and perform these updates; downloading the new one and replacing the old one.

forc update should:

  • If the dependency doesn't have a branch/tag specified, check if there are newer commits on the default branch.
  • If it has a branch specified, check if there are newer commits on the branch specified.
  • if it has a tag specified, check if there is a newer tag based on semver.
  • In case of a hash diff [1], download a new tarball of the updated dependency and replace the previous one with it.

Non-functional requirements needed:

  • Dependency-related code starting to duplicate across forc_build and (the new) forc_update. This needs to be refactored.

[1]: We store the hash in the name of the dependency's locally installed directory

@digorithm digorithm added enhancement New feature or request forc labels Jun 30, 2021
@adlerjohn
Copy link
Contributor

I would say for the second one, instead of

if it has a branch/tag specified, check if there are newer commits on the branch/tag specified

It should be

if it has a branch specified, check if there are newer commits on the branch specified
if it has a tag specified, check if there is a newer tag based on semver

@digorithm
Copy link
Member Author

I would say for the second one, instead of

if it has a branch/tag specified, check if there are newer commits on the branch/tag specified

It should be

if it has a branch specified, check if there are newer commits on the branch specified
if it has a tag specified, check if there is a newer tag based on semver

Perfect! Updated the description.

@adlerjohn adlerjohn linked a pull request Jul 9, 2021 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request forc
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants