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

[Extend] version-automation to rockcraft.yaml #636

Merged
merged 3 commits into from
Jul 1, 2024

Conversation

rudra-iitm
Copy link
Contributor

Extended desktop-snap to support version automation in rockraft.yaml also.

  • Users need to define their version schema in rock-version-schema, and all other rules will follow as in snap, such as:
    • The version should be defined in metadata, and the leading upstream component should be defined in the adopt-info section.
  • The automated version format is the same as that of snap <upstream-version>-<package-release>.
  • When this workflow runs, it checks if there are any updates in the source tag of any part and then updates the version accordingly:
    • If there is a change in the source tag of the leading upstream component, it sets the package release number to 1 and the upstream version to match the leading upstream component.
    • If there is any change in any other source tag, it increments the package release number by 1.

@rudra-iitm
Copy link
Contributor Author

@sergio-costas, pls review this PR also

@rudra-iitm
Copy link
Contributor Author

@sergio-costas, any update on this PR?

@sergio-costas
Copy link
Collaborator

Sorry, didn't receive the notification. I'll check it now.

@@ -62,6 +62,32 @@ def process_snap_version_data(upstreamversion, snap_name, version_schema, has_up
return f"{upstreamversion}-{packagerelease}"


def process_rock_version_data(upstreamversion, prevversion, version_schema, has_update):
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

upstream_version and previous_version

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Updated

return None
upstreamversion = match.group(1).replace('_', '.')

def version_tuple(v):
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do we really need to create a function just for this?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Removed function and now using inline tuple to resolve version

def version_tuple(v):
return tuple(map(int, v.split('.')))

upstream_tuple = version_tuple(upstream_version)
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ehm... Is this a problem in github, or the function is really still there?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sorry I forgot to remove that functions... Now fixed it

Copy link
Collaborator

@sergio-costas sergio-costas left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks fine.

@sergio-costas sergio-costas merged commit d58f616 into ubuntu:stable Jul 1, 2024
1 check passed
@sergio-costas
Copy link
Collaborator

Thanks for the changes.

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

Successfully merging this pull request may close these issues.

2 participants