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

Add a route which returns the API version #112

Closed
RemiBardon opened this issue Jan 4, 2025 · 0 comments · Fixed by #144
Closed

Add a route which returns the API version #112

RemiBardon opened this issue Jan 4, 2025 · 0 comments · Fixed by #144
Assignees
Labels
ci Changes / improvements to the CI enhancement New feature or request

Comments

@RemiBardon
Copy link
Member

RemiBardon commented Jan 4, 2025

Sometimes @Paloma-Sanchez seems to have issues where she runs a Docker image but Dokcer uses an outdated version and bugs aren't fixed as expected. To help detecting this, I suggest we add a route which returns informations about the api version.

We should return the tag, but also the date at which the image was built, which is far easier to reason with.

Also, since we won't have the opportunity to return the current tag for edge and local builds, returning the build date will make total sense.

On the version information route, we could return an object like this:

{
    "version": "v0.4.0 (2025-01-01)",
    "tag": "v0.4.0",
    "build_date": "2025-01-01",
    "build_timestamp": "2025-01-01T22:12:00Z",
    "commit_short": "e3e6bbb",
    "commit_long": "e3e6bbba82fa0d1934990f878c1db376fc35f7d8"
}

This way, we'd support adding more keys in the future if needed.

For local builds, it could look like:

{
    "version": "local (2025-01-04)",
    "tag": "local",
    "build_date": "2025-01-04",
    "build_timestamp": "2025-01-04T11:09:00Z",
    "commit_short": null,
    "commit_long": null
}

(We might want to add commit information if there are no unstaged changes.)

Finally, for edge builds it'd look like this:

{
    "version": "edge (2025-01-01)",
    "tag": "edge",
    "build_date": "2025-01-01",
    "build_timestamp": "2025-01-01T22:15:00Z",
    "commit_short": "e3e6bbb",
    "commit_long": "e3e6bbba82fa0d1934990f878c1db376fc35f7d8"
}

Edit (2025-01-15):

We would like to access Prosody version information too, so to simplify parsing I suggest we switch to this more extensible structure:

{
    "self": {
        "version": "v0.4.0 (2025-01-01)",
        "tag": "v0.4.0",
        "build_date": "2025-01-01",
        "build_timestamp": "2025-01-01T22:12:00Z",
        "commit_short": "e3e6bbb",
        "commit_long": "e3e6bbba82fa0d1934990f878c1db376fc35f7d8"
    },
    "prosody": {
        "version": "...",
        "tag": "...",
        "build_date": "...",
        "build_timestamp": "...",
        "commit_short": "...",
        "commit_long": "..."
    }
}

I haven't thought about it that much but I suppose it will be a bit hard to get some of the information for Prosody. We might have more information about prose-pod-server (~prosody), but it will be complicated because it's not bundled with the API. The API could have this data passed staticly at build time but the version of Prosody running is dynamic.

@RemiBardon RemiBardon added enhancement New feature or request good first issue Good for newcomers ci Changes / improvements to the CI labels Jan 4, 2025
@github-project-automation github-project-automation bot moved this to Backlog & Ideas 💡 in Prose Pod API to-do list Jan 4, 2025
@RemiBardon RemiBardon self-assigned this Jan 4, 2025
@RemiBardon RemiBardon moved this from Backlog & Ideas 💡 to Not Started 🕑 in Prose Pod API to-do list Jan 5, 2025
@RemiBardon RemiBardon removed the good first issue Good for newcomers label Jan 12, 2025
@RemiBardon RemiBardon moved this from Not Started 🕑 to In Progress 🏗️ in Prose Pod API to-do list Jan 16, 2025
@github-project-automation github-project-automation bot moved this from In Progress 🏗️ to Done ✅ in Prose Pod API to-do list Jan 17, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
ci Changes / improvements to the CI enhancement New feature or request
Projects
Status: Done ✅
Development

Successfully merging a pull request may close this issue.

1 participant