Skip to content

Conversation

@AlexInABox
Copy link

@AlexInABox AlexInABox commented Dec 16, 2025

Description

Describe the changes
Releases are now sorted by their God (GitHub) given Id in descending order instead of by their creation time.

What is the current behavior? (You can also link to an open issue here)

[hobby@excitement ~/Downloads] $ ./Exiled.Installer-Linux --get-versions
Exiled.Installer-Linux-4.0.0.0
--- AVAILABLE VERSIONS ---
PRE: False | ID: 270534588 | TAG: v9.11.1  <--- This should NOT be the "newest" release!
   - ID: 329047763 | NAME: Exiled.Installer-Linux | SIZE: 65868504 | URL: https://api.github.com/repos/ExMod-Team/EXILED/releases/assets/329047763 | DownloadURL: https://github.com/ExMod-Team/EXILED/releases/download/v9.11.1/Exiled.Installer-Linux
   - ID: 329047762 | NAME: Exiled.Installer-Win.exe | SIZE: 64415787 | URL: https://api.github.com/repos/ExMod-Team/EXILED/releases/assets/329047762 | DownloadURL: https://github.com/ExMod-Team/EXILED/releases/download/v9.11.1/Exiled.Installer-Win.exe
   - ID: 329066981 | NAME: Exiled.tar.gz | SIZE: 1074841 | URL: https://api.github.com/repos/ExMod-Team/EXILED/releases/assets/329066981 | DownloadURL: https://github.com/ExMod-Team/EXILED/releases/download/v9.11.1/Exiled.tar.gz
PRE: False | ID: 270562189 | TAG: v9.11.2
   - ID: 329082584 | NAME: Exiled.Installer-Linux | SIZE: 65868504 | URL: https://api.github.com/repos/ExMod-Team/EXILED/releases/assets/329082584 | DownloadURL: https://github.com/ExMod-Team/EXILED/releases/download/v9.11.2/Exiled.Installer-Linux
   - ID: 329082583 | NAME: Exiled.Installer-Win.exe | SIZE: 64415787 | URL: https://api.github.com/repos/ExMod-Team/EXILED/releases/assets/329082583 | DownloadURL: https://github.com/ExMod-Team/EXILED/releases/download/v9.11.2/Exiled.Installer-Win.exe
   - ID: 329103691 | NAME: Exiled.tar.gz | SIZE: 1074786 | URL: https://api.github.com/repos/ExMod-Team/EXILED/releases/assets/329103691 | DownloadURL: https://github.com/ExMod-Team/EXILED/releases/download/v9.11.2/Exiled.tar.gz
PRE: False | ID: 270514647 | TAG: v9.11.0

What is the new behavior? (if this is a feature change)

[hobby@excitement ~/Projects/EXILED/EXILED/Exiled.Installer/bin/Debug] $ ./Exiled.Installer --get-versions
Exiled.Installer-4.0.0.0
--- AVAILABLE VERSIONS ---
PRE: False | ID: 270562189 | TAG: v9.11.2  <--- Now THIS is looking correct ^^
   - ID: 329082584 | NAME: Exiled.Installer-Linux | SIZE: 65868504 | URL: https://api.github.com/repos/ExMod-Team/EXILED/releases/assets/329082584 | DownloadURL: https://github.com/ExMod-Team/EXILED/releases/download/v9.11.2/Exiled.Installer-Linux
   - ID: 329082583 | NAME: Exiled.Installer-Win.exe | SIZE: 64415787 | URL: https://api.github.com/repos/ExMod-Team/EXILED/releases/assets/329082583 | DownloadURL: https://github.com/ExMod-Team/EXILED/releases/download/v9.11.2/Exiled.Installer-Win.exe
   - ID: 329103691 | NAME: Exiled.tar.gz | SIZE: 1074786 | URL: https://api.github.com/repos/ExMod-Team/EXILED/releases/assets/329103691 | DownloadURL: https://github.com/ExMod-Team/EXILED/releases/download/v9.11.2/Exiled.tar.gz
PRE: False | ID: 270534588 | TAG: v9.11.1
   - ID: 329047763 | NAME: Exiled.Installer-Linux | SIZE: 65868504 | URL: https://api.github.com/repos/ExMod-Team/EXILED/releases/assets/329047763 | DownloadURL: https://github.com/ExMod-Team/EXILED/releases/download/v9.11.1/Exiled.Installer-Linux
   - ID: 329047762 | NAME: Exiled.Installer-Win.exe | SIZE: 64415787 | URL: https://api.github.com/repos/ExMod-Team/EXILED/releases/assets/329047762 | DownloadURL: https://github.com/ExMod-Team/EXILED/releases/download/v9.11.1/Exiled.Installer-Win.exe
   - ID: 329066981 | NAME: Exiled.tar.gz | SIZE: 1074841 | URL: https://api.github.com/repos/ExMod-Team/EXILED/releases/assets/329066981 | DownloadURL: https://github.com/ExMod-Team/EXILED/releases/download/v9.11.1/Exiled.tar.gz
PRE: False | ID: 270514647 | TAG: v9.11.0

Does this PR introduce a breaking change? (What changes might users need to make in their application due to this PR?)

Other information:


Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)
  • Documentations

Submission checklist

  • I have checked the project can be compiled
  • I have tested my changes and it worked as expected

Patches (if there are any changes related to Harmony patches)

  • I have checked no IL patching errors in the console

Other

  • Still requires more testing

@AlexInABox AlexInABox changed the title fic: change release sorting from CreatedAt to Id fix: change release sorting from CreatedAt to Id Dec 16, 2025
@Someone-193
Copy link
Collaborator

Just to double check, the IDs for releases will always be ascending? (newer releases have higher IDs?)

@AlexInABox
Copy link
Author

AlexInABox commented Dec 18, 2025

According to https://docs.github.com/en/rest/releases/releases?apiVersion=2022-11-28#get-the-latest-release

The latest release is the most recent non-prerelease, non-draft release, sorted by the created_at attribute. The created_at attribute is the date of the commit used for the release, and not the date when the release was drafted or published.

So, created_at effectively references the timestamp of the commit used for the release. In theory, this should work fine for EXILED, but as we can see, it does not.

import requests

URL = "https://api.github.com/repos/ExMod-Team/EXILED/releases"
HEADERS = {"Accept": "application/vnd.github+json"}

releases = requests.get(URL, headers=HEADERS).json()

# take newest 5 releases as returned by GitHub
latest_5 = releases[:5]

# sort by creation date (newest first)
by_created = sorted(
    latest_5,
    key=lambda r: r["created_at"],
    reverse=True
)

# sort by GitHub release ID (highest first)
by_id = sorted(
    latest_5,
    key=lambda r: r["id"],
    reverse=True
)

by_published = sorted(
    latest_5,
    key=lambda r: r["published_at"],
    reverse=True
)

print("Newest by creation date:", by_created[0]["tag_name"])
print("Newest by id:", by_id[0]["tag_name"])
print("Newest by publish date:", by_published[0]["tag_name"])

I wrote this quick Python script to compare the different sorting approaches:

Newest by creation date: v9.11.1
Newest by id: v9.11.2
Newest by publish date: v9.11.2

@Someone-193

Just to double-check, are release IDs always ascending? In other words, do newer releases always have higher IDs?

I cannot find any documentation from GitHub explaining how this ID is generated. However, sorting by published_at seems to be the better approach here. Since the latest published release by a maintainer should always represent the most recent EXILED version users are expected to install, this appears to be the most reliable metric.

Co-authored-by: AlexInABox <36812824+AlexInABox@users.noreply.github.com>
@louis1706 louis1706 merged commit ced8516 into ExMod-Team:dev Dec 18, 2025
6 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants