-
-
Notifications
You must be signed in to change notification settings - Fork 2.6k
Feat/installation info endpoint #7744
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
Feat/installation info endpoint #7744
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Overall direction seems good, thanks!
server/presenters/installation.ts
Outdated
@@ -0,0 +1,11 @@ | |||
export default function presentInstallationInfo(data: { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No need for the presenter, just return the object in the router directly 👍
router.post( | ||
"installation.info", | ||
auth(), | ||
validate(T.InstallationInfoSchema), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can remove the validation and schema as there is no POST body required
server/utils/getInstallationInfo.ts
Outdated
"https://hub.docker.com/v2/repositories/outlinewiki/outline"; | ||
|
||
export function getVersion(): string { | ||
return env.VERSION ? env.VERSION : version; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Don't use env.VERSION
here, it might be a sha
or some other non-semver value, the version in package.json
is the right one to use
4bdd6e2
to
030e2f7
Compare
I mistakenly rebased my branch with the current version of the main branch, so I force-pushed the changes. However, I’ve kept all fixes and adjustments in separate commits for easier review. Additionally, the documentation for this endpoint still needs to be written. I may not be able to complete it in the near future, it might be better to leave this as a separate issue for someone else to handle. I’m open to your thoughts on this! |
Thanks, no worries on the rebase |
lmk if you're thinking of finishing this, or if you'd like someone to take it over. Thanks! |
030e2f7
to
de0a99e
Compare
Hey there, First of all, I’d like to apologize for my absence over the past two weeks. I had some other priorities, but I’ve now returned to this issue and I’m ready to move it forward. Regarding the full-release logic: I’ve assumed that a full release is any version that matches the following templates:
I couldn’t find any field in DockerHub that explicitly identifies whether a version is a pre-release or full release, so this regex-based approach should cover most cases. If I’m mistaken and there’s a specific DockerHub field for this, the logic can be easily updated to accommodate that. I’ve also included a few screenshots to demonstrate how the UI behaves when I manually change the version number in package.json: This should give you a better sense of how the changes are reflected visually. Let me know if you have any further suggestions or thoughts on improving this implementation! |
That sounds right, It's just a matter of parsing the version number. I think one improvement here would be to use the |
Thank you for the review and the approval. I’m looking forward to seeing this merged! |
This PR adds an endpoint for fetching version information, integrated with DockerHub. Discussed in #7700
The stack and language used here are completely new for me, so I approached it intuitively. I would really appreciate any feedback or suggestions for improvement!
I have tested endpoint manually. I'm still working on the automatic tests for this endpoint, but wanted to get an initial review to ensure I'm on the right track.