Opened 11 years ago

Closed 10 years ago

Last modified 8 years ago

#2425 closed enhancement (fixed)

Implement dotted activity versions to sugar 0.92

Reported by: godiard Owned by: erikos
Priority: Normal Milestone:
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 (7)

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

Download all attachments as: .zip

Change History (17)

Changed 11 years ago by godiard

comment:1 Changed 11 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.

comment:2 Changed 11 years ago by godiard

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

comment:3 Changed 11 years ago by sascha_silbe

  • Resolution set to duplicate
  • Status changed from new to closed

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.

comment:4 Changed 11 years ago by erikos

  • Resolution duplicate deleted
  • Status changed from closed to reopened

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 11 years ago by erikos

New NormalizedVersion class

comment:5 Changed 11 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.

comment:6 Changed 11 years ago by erikos

  • Cc godiard added

Changed 10 years ago by erikos

New patch for the shell (activity list, bundleregistry)

Changed 10 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

comment:7 Changed 10 years ago by erikos

  • Keywords r? added; r! removed
  • Owner changed from tomeu to erikos
  • Status changed from reopened to assigned

comment:8 Changed 10 years ago by godiard

The changes are ok.

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

comment:9 Changed 10 years ago by erikos

  • Keywords r? removed
  • Resolution set to fixed
  • Status changed from assigned to closed

comment:10 Changed 8 years ago by dnarvaez

  • Milestone 0.92 deleted

Milestone 0.92 deleted

Note: See TracTickets for help on using tickets.