8000 Feat/installation info endpoint by AlexandrZagorskiy · Pull Request #7744 · outline/outline · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

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

Merged

Conversation

AlexandrZagorskiy
Copy link
Contributor

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.

@auto-assign auto-assign bot requested a review from tommoor October 8, 2024 15:11
@CLAassistant
Copy link
CLAassistant commented Oct 8, 2024

CLA assistant check
All committers have signed the CLA.

Copy link
Member
@tommoor tommoor left a 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!

@@ -0,0 +1,11 @@
export default function presentInstallationInfo(data: {
Copy link
Member

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),
Copy link
Member

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

"https://hub.docker.com/v2/repositories/outlinewiki/outline";

export function getVersion(): string {
return env.VERSION ? env.VERSION : version;
Copy link
Member

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

@AlexandrZagorskiy AlexandrZagorskiy force-pushed the feat/installation-info-endpoint branch from 4bdd6e2 to 030e2f7 Compare October 10, 2024 22:28
@AlexandrZagorskiy
Copy link
Contributor Author
AlexandrZagorskiy commented Oct 10, 2024

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!

That's how it looks on my local development version:
image
image

@tommoor
Copy link
Member
tommoor commented Oct 10, 2024

Thanks, no worries on the rebase

@tommoor
Copy link
Member
tommoor commented Oct 22, 2024

lmk if you're thinking of finishing this, or if you'd like someone to take it over. Thanks!

@AlexandrZagorskiy AlexandrZagorskiy force-pushed the feat/installation-info-endpoint branch from 030e2f7 to de0a99e Compare October 23, 2024 23:00
@AlexandrZagorskiy
Copy link
Contributor Author

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:
image
image
image
image

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!

@tommoor
Copy link
Member
tommoor commented Oct 24, 2024

I couldn’t find any field in DockerHub that explicitly identifies whether a version is a pre-release or full release

That sounds right, It's just a matter of parsing the version number. I think one improvement here would be to use the semver library to deal with the version number. I'm going to merge now, but we could come back and fix that – it would make it more resilient and the dependency is already included.

@AlexandrZagorskiy
Copy link
Contributor Author

Thank you for the review and the approval. I’m looking forward to seeing this merged!

@tommoor tommoor merged commit 2e1a827 into outline:main Oct 25, 2024
11 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants
0