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

qube compares against the master branch when syncing #227

Open
Zethson opened this issue Nov 11, 2020 · 2 comments
Open

qube compares against the master branch when syncing #227

Zethson opened this issue Nov 11, 2020 · 2 comments
Labels
bug Something isn't working

Comments

@Zethson
Copy link
Collaborator

Zethson commented Nov 11, 2020

Sometimes people merge new templates into the development branches and do not create new releases. Hence, the new template version only resides in the development branch.

However, when cloning the repository in the automatic sync the new version is compared against the master branch, which may still have the old template version. Despite the new version already being merged into the development branch annoying sync pushes occur.

I suggest 2 things:

  1. blacklist changelog.rst as @sven1103 already suggested.
  2. Adapt sync.py to something like
     def has_template_version_changed(self, project_dir: Path) -> (bool, bool, bool, str, str):
        """
        Check, if the mlf-core template has been updated since last check/sync of the user.
        :return: Both false if no versions changed or a micro change happened (for ex. 1.2.3 to 1.2.4). Return is_major_update True if a major version release
        happened for the mlf-core template (for example 1.2.3 to 2.0.0). Return is_minor_update True if a minor change happened (1.2.3 to 1.3.0).
        Return is_patch_update True if its a micro update (for example 1.2.3 to 1.2.4).
        mlf-core will use this to decide which syncing strategy to apply. Also return both versions.
        """
        # Try to compare against the development branch, since it is the most up to date (usually).
        # If a development branch does not exist compare against master.
        repo = git.Repo(self.project_dir)
        try:
            repo.git.checkout('development')
        except git.exc.GitCommandError:
            print('[bold red]Could not checkout development branch. Trying to checkout master...')
            try:
                repo.git.checkout('master')
            except git.exc.GitCommandError as e:
                print(f'[bold red]Could not checkout master branch.\n{e}')
                sys.exit(1)

As a result when syncing the version will be checked against the development branch.

Cheers

@Zethson
Copy link
Collaborator Author

Zethson commented Nov 11, 2020

Example of this issue:

qbicsoftware/offer-manager-2-portlet#89

@sven1103
Copy link
Contributor

👍

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants