Ticket #2425 (closed enhancement: fixed)

Opened 3 years ago

Last modified 3 years ago

Implement dotted activity versions to sugar 0.92

Reported by: godiard Owned by: erikos
Priority: Normal Milestone: 0.92
Component: sugar Version: Unspecified
Severity: Unspecified Keywords:
Cc: godiard Distribution/OS: Unspecified
Bug Status: New

Description

When we are supporting old releases, we need to update activities but without changing the version number, because there are activities released with the next numbers.

For example, in sugar 0.84 we are using Browse 108, the last version of Browse is 112. We need to create a new activity, but can't be 109, because exists, and we don't want to inhibit future updates.

Another use case is we can need create a modified activity to a unique group, by example a deployment, then we can create the activity Browse 108.1-peru

Attachments

0001-Add-class-to-parse-and-compare-the-bundles-version-n.patch Download (8.6 KB) - added by godiard 3 years ago.
0002-Changes-to-use-a-string-insted-of-a-int-in-the-activ.patch Download (2.5 KB) - added by godiard 3 years ago.
0001-Changes-to-use-a-activity-version-with-a-dotted-sche.patch Download (3.7 KB) - added by godiard 3 years ago.
Calculate-34.1.xo Download (430.1 KB) - added by godiard 3 years ago.
normalized_version.patch Download (5.3 KB) - added by erikos 3 years ago.
New NormalizedVersion class
0001-Adopt-to-new-numbering-scheme-2425.patch Download (3.8 KB) - added by erikos 3 years ago.
New patch for the shell (activity list, bundleregistry)
0001-Add-new-numbering-scheme-2425.patch Download (8.7 KB) - added by erikos 3 years ago.
toolkit: add class NormalizedVersion to parse and compare the new activity versions, change the bundlebuilder and activitybundle to use the new scheme

Change History

Changed 3 years ago by godiard

Changed 3 years ago by godiard

The patches 0001-Add-class-to-parse-and-compare-the-bundles-version-n.patch and 0002-Changes-to-use-a-string-insted-of-a-int-in-the-activ.patch apply over sugar-toolkit.

The patch 0001-Changes-to-use-a-activity-version-with-a-dotted-sche.patch apply over sugar.

|TestCase|

You can download with Browse the file  http://bugs.sugarlabs.org/attachment/ticket/2425/Calculate-34.1.xo and start from Journal. It must install the activity. In the List View from the Home, you must see the version 34.1

The changes in the updater will be added next.

Changed 3 years ago by godiard

This ticket is related to  http://dev.laptop.org/ticket/10379 where is implemented the change in Sugar 0.84

Changed 3 years ago by sascha_silbe

  • status changed from new to closed
  • resolution set to duplicate

This is a dupe of #1701. It's hard to decide which one to close as both have files attached. I'm closing this one as #1701 has some discussion and is (much) older.
I'll add you to CC on #1701 and mention that you have files attached here. Please post any follow-up (including new or updated attachments) on #1701 and not this one.

Changed 3 years ago by erikos

  • status changed from closed to reopened
  • resolution duplicate deleted

I think we should close #1701 as this one is the current approach and the work in #1701 is obsoleted. The comments in there are just in regards to the patch which won't be taken on anyhow.

Changed 3 years ago by erikos

New NormalizedVersion class

Changed 3 years ago by erikos

  • keywords r! added

While reviewing I did edit the file and corrected the things I were not happy with. I have attached a  new file for the NormalizedVersion. The following things I have changed:

I used the documentation format as described  PEP-257 (PEP-8 says to use PEP-257).

I removed 'error_on_huge_major_num' as a class argument because it was not used.

I do check if the parsed activity version is a string. So we raise our error and do not trigger the one from the regular expression.

I reorganized the parsing of the string. I hope this helps in terms of clearer variable naming, method naming and general readability.

I removed 'pad_zeros_length' from '_parse_numdots' because from our calls it would never happen.

'_parts_to_str' does not have to be a @classmethod, and actually, I moved that one liner in the 'str' method as I think it is quite clear.

I made 'parts' public so we can use it in the comparisons. I have seen that you did use 'get_parts' but I think a public method does suggest that as a caller you would be interested in that, which I do not think is true here.

--- General Note ---:
Please use pylint and pep8, in sugar-jhbuild can be done as:

pep8 sugar-jhbuild/source/sugar-toolkit/src/sugar/bundle/bundleversion.py
pylint sugar-jhbuild/source/sugar-toolkit/src/sugar/bundle/bundleversion.py

pep8 is a Fedora package:  http://koji.fedoraproject.org/koji/packageinfo?packageID=9499

I cleaned up the code for both.


I think that is pretty much it. Please let me know if the changes are for the better if you have comments other ideas etc.

Changed 3 years ago by erikos

  • cc godiard added

Changed 3 years ago by erikos

New patch for the shell (activity list, bundleregistry)

Changed 3 years ago by erikos

toolkit: add class NormalizedVersion to parse and compare the new activity versions, change the bundlebuilder and activitybundle to use the new scheme

Changed 3 years ago by erikos

  • keywords r? added; r! removed
  • owner changed from tomeu to erikos
  • status changed from reopened to assigned

Changed 3 years ago by godiard

The changes are ok.

Reviewed-by: "Gonzalo Odiard" <godiard@…>

Changed 3 years ago by erikos

  • keywords r? removed
  • status changed from assigned to closed
  • resolution set to fixed
Note: See TracTickets for help on using tickets.