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

added version command + api endpoint #321

Merged
merged 4 commits into from
Sep 24, 2018
Merged

added version command + api endpoint #321

merged 4 commits into from
Sep 24, 2018

Conversation

kevinpapst
Copy link
Member

@kevinpapst kevinpapst commented Sep 23, 2018

Fixes #320

Adds new API endpoint /api/version with example output:

{
    "version": 0.5,
    "candidate": "dev",
    "semver": "0.5-dev",
    "name": "version-name",
    "copyright": "Kimai 2 - 0.5 dev (version-name) by Kevin Papst and contributors."
}

Adds new command bin/console kimai:version with options:

  • --name
  • --status
  • --short

With example outputs:

$ bin/console kimai:version
Kimai 2 - 0.5 dev (version-name) by Kevin Papst and contributors.

$ bin/console kimai:version --short
0.5

$ bin/console kimai:version --candidate
dev

$ bin/console kimai:version --semver
0.5-dev

$ bin/console kimai:version --name
version-name

ping @anmol26s / @bastilimbach maybe interesting for you?

@kevinpapst kevinpapst added this to the 0.5 - Invoice milestone Sep 23, 2018
@bastilimbach
Copy link

I just tested the API. Works flawlessly 👍 Maybe you could change the type of version to a Float or Double instead of a String.

@bastilimbach
Copy link

bastilimbach commented Sep 23, 2018

This would of course limit version names to numbers. So a 0.5-rc version wouldn't be possible but the API clients could test the version using the greater than the operator if Kimai2 would avoid using these types of version declaration.

@kevinpapst
Copy link
Member Author

The -rc would never be included in the version field, only in status.
You can definitely rely on casting the value and comparing it.

What I will do:

  • think about changing it to float
  • renaming status to candidate or something else which fits better

@bastilimbach
Copy link

Ok. I'll cast it myself for now 👍

@kevinpapst
Copy link
Member Author

@bastilimbach updated API - see adjusted examples in the initial comment. will merge it tomorrow.

@kevinpapst kevinpapst added the API label Sep 24, 2018
@kevinpapst kevinpapst merged commit 7bcd6a6 into master Sep 24, 2018
@kevinpapst kevinpapst deleted the version branch September 24, 2018 13:56
@lock
Copy link

lock bot commented Nov 23, 2018

This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

@lock lock bot locked and limited conversation to collaborators Nov 23, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants