Skip to content

Improve order of release processing #28

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

Merged
merged 2 commits into from
May 21, 2021
Merged

Improve order of release processing #28

merged 2 commits into from
May 21, 2021

Conversation

per1234
Copy link
Contributor

@per1234 per1234 commented May 21, 2021

Previously, library releases were processed in a lexicographical order. This meant that, for example a 1.0.10 tag was
processed before a 1.0.2 tag. In addition to making the logs difficult to read, it's possible this could result in
unexpected results in the event multiple library releases had the same library.properties version value.

The most intuitive sorting order is to follow the order of the commits the tags are associated with in the Git history.

You can see an example of the previous behavior here:
https://downloads.arduino.cc/libraries/logs/github.com/arduino-libraries/ArduinoIoTCloud/

JOB 053 - 2021/05/21 07:23:28 Scraping https://github.com/arduino-libraries/ArduinoIoTCloud.git
JOB 053 - 2021/05/21 07:23:28 Checking out tag: 0.1.0
JOB 053 - 2021/05/21 07:23:29 Error syncing library: Error generating library from repo: 'sentence' and 'url' fields must be defined
JOB 053 - 2021/05/21 07:23:29 Checking out tag: 0.10.0
JOB 053 - 2021/05/21 07:23:29 Release ArduinoIoTCloud:0.10.0 already loaded, skipping
JOB 053 - 2021/05/21 07:23:29 Checking out tag: 0.11.0
JOB 053 - 2021/05/21 07:23:29 Release ArduinoIoTCloud:0.11.0 already loaded, skipping
JOB 053 - 2021/05/21 07:23:29 Checking out tag: 0.11.1
JOB 053 - 2021/05/21 07:23:29 Release ArduinoIoTCloud:0.11.1 already loaded, skipping
JOB 053 - 2021/05/21 07:23:29 Checking out tag: 0.11.2
JOB 053 - 2021/05/21 07:23:29 Release ArduinoIoTCloud:0.11.2 already loaded, skipping
JOB 053 - 2021/05/21 07:23:29 Checking out tag: 0.11.3
JOB 053 - 2021/05/21 07:23:29 Release ArduinoIoTCloud:0.11.3 already loaded, skipping
JOB 053 - 2021/05/21 07:23:29 Checking out tag: 0.12.0
JOB 053 - 2021/05/21 07:23:29 Release ArduinoIoTCloud:0.12.0 already loaded, skipping
JOB 053 - 2021/05/21 07:23:29 Checking out tag: 0.13.0
JOB 053 - 2021/05/21 07:23:29 Release ArduinoIoTCloud:0.13.0 already loaded, skipping
JOB 053 - 2021/05/21 07:23:29 Checking out tag: 0.13.1
JOB 053 - 2021/05/21 07:23:29 Release ArduinoIoTCloud:0.13.1 already loaded, skipping
JOB 053 - 2021/05/21 07:23:29 Checking out tag: 0.2.0

per1234 added 2 commits May 21, 2021 01:03
The initial porting from `github.com/arduino/arduino-modules/git` to `github.com/go-git/go-git` was done with the
intention to follow the pre-existing code structure as closely as possible. This resulted in some code duplication.
Although minimal, the duplicated code was fairly complex and related to somewhat obscure details of how Git tags work.
With work in progress to add even more such complex Git repository handling code, it makes sense to functionalize this
previously duplicated code, which also facilitates testing.
Previously, library releases were processed in a lexicographical order. This meant that, for example a 1.0.10 tag was
processed before a 1.0.2 tag. In addition to making the logs difficult to read, it's possible this could result in
unexpected results in the event multiple library releases had the same library.properties value.

The most intuitive sorting order is to follow the order of the commits the tags are associated with in the Git history.
@per1234 per1234 added type: enhancement Proposed improvement topic: code Related to content of the project itself labels May 21, 2021
@per1234 per1234 merged commit 2344567 into arduino:main May 21, 2021
@per1234 per1234 deleted the tags-order branch May 21, 2021 09:28
@per1234 per1234 self-assigned this Nov 20, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
topic: code Related to content of the project itself type: enhancement Proposed improvement
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants