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

exposes simple version in support header #2754

Merged
merged 2 commits into from
Sep 27, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

434 changes: 220 additions & 214 deletions backend/gen/go/protos/mgmt/v1alpha1/user_account.pb.go

Large diffs are not rendered by default.

8 changes: 7 additions & 1 deletion backend/protos/mgmt/v1alpha1/user_account.proto
Original file line number Diff line number Diff line change
Expand Up @@ -145,9 +145,13 @@

message GetSystemInformationRequest {}
message GetSystemInformationResponse {
// The Git tagged version
string version = 1;
// The Git commit
string commit = 2;
// The Go compiler flag that was used to build this version of Neosync
string compiler = 3;
// The Go platform flag that was used to build this version of Neosync
string platform = 4;
google.protobuf.Timestamp build_date = 5;
}
Expand Down Expand Up @@ -275,7 +279,9 @@
rpc RemoveTeamAccountInvite(RemoveTeamAccountInviteRequest) returns (RemoveTeamAccountInviteResponse) {}
rpc AcceptTeamAccountInvite(AcceptTeamAccountInviteRequest) returns (AcceptTeamAccountInviteResponse) {}

rpc GetSystemInformation(GetSystemInformationRequest) returns (GetSystemInformationResponse) {}
rpc GetSystemInformation(GetSystemInformationRequest) returns (GetSystemInformationResponse) {
option idempotency_level = NO_SIDE_EFFECTS;

Check failure on line 283 in backend/protos/mgmt/v1alpha1/user_account.proto

View workflow job for this annotation

GitHub Actions / buf

RPC "GetSystemInformation" on service "UserAccountService" changed option "idempotency_level" from "IDEMPOTENCY_UNKNOWN" to "NO_SIDE_EFFECTS".
}

rpc GetAccountOnboardingConfig(GetAccountOnboardingConfigRequest) returns (GetAccountOnboardingConfigResponse) {}
rpc SetAccountOnboardingConfig(SetAccountOnboardingConfigRequest) returns (SetAccountOnboardingConfigResponse) {}
Expand Down
13 changes: 8 additions & 5 deletions docs/protos/data/proto_docs.json
Original file line number Diff line number Diff line change
Expand Up @@ -14330,7 +14330,7 @@
"fields": [
{
"name": "version",
"description": "",
"description": "The Git tagged version",
"label": "",
"type": "string",
"longType": "string",
Expand All @@ -14342,7 +14342,7 @@
},
{
"name": "commit",
"description": "",
"description": "The Git commit",
"label": "",
"type": "string",
"longType": "string",
Expand All @@ -14354,7 +14354,7 @@
},
{
"name": "compiler",
"description": "",
"description": "The Go compiler flag that was used to build this version of Neosync",
"label": "",
"type": "string",
"longType": "string",
Expand All @@ -14366,7 +14366,7 @@
},
{
"name": "platform",
"description": "",
"description": "The Go platform flag that was used to build this version of Neosync",
"label": "",
"type": "string",
"longType": "string",
Expand Down Expand Up @@ -15349,7 +15349,10 @@
"responseType": "GetSystemInformationResponse",
"responseLongType": "GetSystemInformationResponse",
"responseFullType": "mgmt.v1alpha1.GetSystemInformationResponse",
"responseStreaming": false
"responseStreaming": false,
"options": {
"idempotency_level": "NO_SIDE_EFFECTS"
}
},
{
"name": "GetAccountOnboardingConfig",
Expand Down
12 changes: 12 additions & 0 deletions frontend/apps/web/components/site-header/NeosyncVersion.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
'use client';
import { useQuery } from '@connectrpc/connect-query';
import { getSystemInformation } from '@neosync/sdk/connectquery';
import { ReactElement } from 'react';

export default function NeosyncVersion(): ReactElement | null {
const { data } = useQuery(getSystemInformation);
if (!data?.version) {
return null;
}
return <p className="text-sm tracking-tight">{data.version}</p>;
}
8 changes: 7 additions & 1 deletion frontend/apps/web/components/site-header/SiteHeader.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ import AccountSwitcher from './AccountSwitcher';
import { MainNav } from './MainNav';
import { MobileNav } from './MobileNav';
import { ModeToggle } from './ModeToggle';
import NeosyncVersion from './NeosyncVersion';
import Upgrade from './Upgrade';
import { UserNav } from './UserNav';

Expand Down Expand Up @@ -52,7 +53,12 @@ function SupportSheet(): ReactElement {
</SheetTrigger>
<SheetContent className="w-[400px] sm:w-[540px]">
<SheetHeader>
<SheetTitle>Support</SheetTitle>
<div className="flex flex-col md:flex-row gap-2 items-center justify-between">
<SheetTitle>Support</SheetTitle>
<div>
<NeosyncVersion />
</div>
</div>
<SheetDescription>Need help? We got you covered.</SheetDescription>
</SheetHeader>
<SupportDrawer />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -225,6 +225,7 @@ export const getSystemInformation = {
kind: MethodKind.Unary,
I: GetSystemInformationRequest,
O: GetSystemInformationResponse,
idempotency: MethodIdempotency.NoSideEffects,
service: {
typeName: "mgmt.v1alpha1.UserAccountService"
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -155,6 +155,7 @@ export const UserAccountService = {
I: GetSystemInformationRequest,
O: GetSystemInformationResponse,
kind: MethodKind.Unary,
idempotency: MethodIdempotency.NoSideEffects,
},
/**
* @generated from rpc mgmt.v1alpha1.UserAccountService.GetAccountOnboardingConfig
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1445,21 +1445,29 @@ export class GetSystemInformationRequest extends Message<GetSystemInformationReq
*/
export class GetSystemInformationResponse extends Message<GetSystemInformationResponse> {
/**
* The Git tagged version
*
* @generated from field: string version = 1;
*/
version = "";

/**
* The Git commit
*
* @generated from field: string commit = 2;
*/
commit = "";

/**
* The Go compiler flag that was used to build this version of Neosync
*
* @generated from field: string compiler = 3;
*/
compiler = "";

/**
* The Go platform flag that was used to build this version of Neosync
*
* @generated from field: string platform = 4;
*/
platform = "";
Expand Down
Loading