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

Update /xh endpoints and config for version/instance change detection #387

Merged
merged 12 commits into from
Sep 3, 2024

Conversation

ghsolomon
Copy link
Contributor

…ropriate defaults

@ghsolomon
Copy link
Contributor Author

Associated with HR PR: xh/hoist-react#3768

@@ -219,8 +219,8 @@ class XhController extends BaseController {
renderJSON(environmentService.getEnvironment())
}

def version() {
def options = configService.getMap('xhAppVersionCheck', [:])
def status() {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

confusing with our status monitors?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

connectionCheck? heartbeat?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

  • We could continue with /status, but plan to expand the payload here at a later point to include
    health/readiness information.
    • Could include some highly summarized version of the actual status monitor outputs (eg counts only), if only to acknowledge those have some claim to "status". Although for this whitelisted endpoint we obvs would not want to output anything more detailed (not even, say, the names of monitors).
    • But thinking ahead to this including some general ready:true indicator helps to justify the name - which I like (mostly because it's difficult to come up with another, better name...)
  • /instance, /instanceInfo or /instanceDetails would be my other suggestion. It might be a bit weird to have the other version-check related instructions in a return with that name, but not that weird.
    • If we felt the need, we could always nest those under a sub-key in the return, like versionCheck

tldr; I am OK with status if we plan to expand the payload to ready checks, but suggest instance otherwise.

@@ -219,8 +219,8 @@ class XhController extends BaseController {
renderJSON(environmentService.getEnvironment())
}

def version() {
def options = configService.getMap('xhAppVersionCheck', [:])
def status() {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

  • We could continue with /status, but plan to expand the payload here at a later point to include
    health/readiness information.
    • Could include some highly summarized version of the actual status monitor outputs (eg counts only), if only to acknowledge those have some claim to "status". Although for this whitelisted endpoint we obvs would not want to output anything more detailed (not even, say, the names of monitors).
    • But thinking ahead to this including some general ready:true indicator helps to justify the name - which I like (mostly because it's difficult to come up with another, better name...)
  • /instance, /instanceInfo or /instanceDetails would be my other suggestion. It might be a bit weird to have the other version-check related instructions in a return with that name, but not that weird.
    • If we felt the need, we could always nest those under a sub-key in the return, like versionCheck

tldr; I am OK with status if we plan to expand the payload to ready checks, but suggest instance otherwise.

grails-app/init/io/xh/hoist/BootStrap.groovy Outdated Show resolved Hide resolved
grails-app/init/io/xh/hoist/BootStrap.groovy Outdated Show resolved Hide resolved
CHANGELOG.md Outdated Show resolved Hide resolved
+ Tailor /xh/environment return based on auth user - support minimal unauthorized payload for backwards compat with existing usages, but mix-in full details for authenticated users.
+ Client now calls this endpoint both for initial load and for ongoing polling.
+ Rework `xhAppStatusCheck` to `xhEnvPollingConfig`, nest within authenticated /xh/environment return. Client reads and respects changes to config updates, with some sanity checks.
+ Restore /xh/version for backwards compat, return minimal environment summary.
@amcclain amcclain changed the title Rename xhAppVersionCheck -> xhAppStatusCheck and provide more app… Update /xh endpoints and config for version/instance change detection Aug 31, 2024
@amcclain
Copy link
Member

Had a discussion with Lee earler this evening and throwing these changes over the wall to see if you guys think this holds together.

While the client-side code does not save down all the data produced by /xh/environment on its polling checks, I was still happy to not need another endpoint and this should always be cheap / safe to call.

Retained /xh/version for compatibility, but delegating to the same. Was also looking at what whitelisted /xh/environment has been returning to unauthenticated clients and felt like it was more than we would actually want - especially the library versions. But do not believe the slimmed down payload would break any current usages.

lbwexler and others added 6 commits August 31, 2024 19:01
+ Remove dedicated `PingController`
+ Add extra info - appCode, timestamp, success:true - from ping to version output.
Copy link
Member

@amcclain amcclain left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks like a good place to land to me 👍

@lbwexler lbwexler merged commit 5df3ca0 into develop Sep 3, 2024
4 checks passed
@lbwexler lbwexler deleted the handleInstanceChanges branch September 3, 2024 20:45
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