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

Make command-line tools accept minor I/O version numbers as well. #397

Open
spbnick opened this issue Mar 17, 2023 · 6 comments
Open

Make command-line tools accept minor I/O version numbers as well. #397

spbnick opened this issue Mar 17, 2023 · 6 comments
Labels
good first issue Good for newcomers

Comments

@spbnick
Copy link
Collaborator

spbnick commented Mar 17, 2023

We've added support for requesting a specific major I/O schema version to various tools, such as kcidb-schema, kcidb-validate and so on, a while ago. That was done when we had separate objects for major versions only. Now we have separate objects for minor versions as well. Make the tool accept a version string as well (as handled by kcidb.misc.version() argument type, e.g. v4.1), and outputting the corresponding version of the I/O schema. However, make it still accept just the sole major version number and output the latest minor version with the specified major number (as it was done before). This would involve modifying the kcidb.misc.argparse_schema_add_args() function.

@spbnick spbnick added the good first issue Good for newcomers label Mar 17, 2023
@spbnick spbnick changed the title Make kcidb-schema accept minor version number as well. Make command-line tools accept minor I/O version numbers as well. Mar 17, 2023
@Biswajit-Behera
Copy link

Hi currently I am working on this!
Will generate PR soon!

@octonawish-akcodes
Copy link
Contributor

@spbnick dont you think this will be covered in PR #394 ?

@spbnick
Copy link
Collaborator Author

spbnick commented Mar 30, 2023

@octonawish-akcodes, not exactly. The #394 needs to make the database tools accept a full I/O version where we specify the database schema (picking a corresponding one). This issue is about the tools which purely operate on I/O schema versions (not DB schema versions), like kcidb-schema and kcidb-upgrade. Although #394 could possibly reuse the code for parsing (and validating) I/O schema versions required for this one.

@spbnick
Copy link
Collaborator Author

spbnick commented Apr 4, 2023

Removing @Biswajit-Behera from the assignees, as Outreachy's initial contribution period is now over.

@danghai
Copy link
Collaborator

danghai commented Dec 4, 2023

@spbnick what does it mean major and minor number of schema? Why are these numbers important?
the input string is v4.1, it means major is 4 and minor 1?
4.1 is not valid because it requires v prefix?, 4 is not valid too because minor is 0?

@spbnick
Copy link
Collaborator Author

spbnick commented Dec 5, 2023

what does it mean major and minor number of schema? Why are these numbers important?

The schema documents the function of the major and minor version numbers. But in short, minor number increases signify backwards-compatible changes, and major number increases - backwards-incompatible. Check out the I/O schema versions in kcidb-io for more context.

the input string is v4.1, it means major is 4 and minor 1?

Yep! Except we shouldn't require the v (I suspect I just didn't think the example in the description through).

4.1 is not valid because it requires v prefix?, 4 is not valid too because minor is 0?

Currently we accept just a single integer signifying a version with the specified major number and the latest minor number. We also need to accept a complete specification of the version (both major and minor numbers). I don't think we need to require the v prefix. Just e.g. 4 (meaning v4.<latest_minor>) or 4.1 (meaning v4.1). Even though looking at it as a rational number, we might read 4 as 4.0, we need to support the old method, at least for now, and anyway version arithmetic is a little weird, so hopefully we'll be able to remove support for single-number interface before anybody complains 🙈

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
good first issue Good for newcomers
Projects
None yet
Development

No branches or pull requests

4 participants