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

Create versionned directories of the helpers #1717

Merged
merged 4 commits into from May 27, 2024

Conversation

Salamandar
Copy link
Contributor

@Salamandar Salamandar commented Sep 28, 2023

The problem

Having a single helpers directory completely freezes its API, we don't want to change it by fear of breaking old or unmaintained apps.
But sometimes we see bugs, deprecated functions, want to change the overall API, want to introduce new behaviours.

Solution

This MR introduces a new variable, YNH_APP_HELPERS_VERSION.

This variable can be passed as an env var, or as the first arg of the script (source /usr/share/yunohost/helpers 2.1). It defaults to 1.

Directories are named helpers.v${VERSION}.d.
A symlink helpers.d -> helpers.v1.d keeps the "legacy" directory.
The version 1 is the current one, so old packages won't break.

PR Status

Completely untested.

How to test

...

Copy link
Member

@kay0u kay0u left a comment

Choose a reason for hiding this comment

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

I like the idea, but I'm not sure that the package version must follow the helper version.
To me it's completely uncorrelated, and we could have a turbo package V5 with helper v2 because it doesn't evolve as fast as the package needs etc.

We could use a key in the manifest, and if it's not declared, use helperV1.

@Salamandar
Copy link
Contributor Author

Salamandar commented May 26, 2024

I'm not sure that the package version must follow the helper version. To me it's completely uncorrelated, and we could have a turbo package V5 with helper v2 because it doesn't evolve as fast as the package needs etc.

If i understand your idea correctly, you would just like to decorrelate versionning of the 2 ? That i'm fine with. Correlating the two numbers was just a simplification. We just need to be clear about the "compat matrix". (for now packagingv1 is helpers v1, packagingv2 is helpers v1 and v2).

We could use a key in the manifest, and if it's not declared, use helperV1.
Yes that's what I did :)

@selfhoster1312
Copy link
Contributor

Great idea!

Why not add a helpers_version to manifest.toml so that we can easily detect repo-wide which apps need to be updated for newer versions?

@alexAubin
Copy link
Member

hmmyeah i guess we could have something like

[integration]
yunohost = ">= 11.2"
helpers = "2.1"

or

packaging_format = 2
helpers_version = 2.1

@Salamandar
Copy link
Contributor Author

I think I prefer the first suggestion, because it's less about the format and more about "dependencies" like yunohost version.

…y in the manifest's [integration] section, or fallback to the 'packaging_format' info
@alexAubin alexAubin merged commit c1b3c3f into YunoHost:dev May 27, 2024
2 checks passed
@Salamandar Salamandar deleted the helpers branch May 28, 2024 12:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
4 participants