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

test-dbbaff4 #2512

Merged
merged 1 commit into from
Apr 17, 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
4 changes: 2 additions & 2 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -19,15 +19,15 @@ RUN corepack enable
RUN corepack prepare yarn@stable --activate

# bump to update website
ENV WEBSITE_VERSION 0.11.5-next.5c0e2e08
ENV WEBSITE_VERSION 0.11.6
COPY . /workdir

RUN /usr/bin/yarn --cwd website \
&& /usr/bin/yarn --cwd website compile \
&& /usr/bin/yarn --cwd website build

# Main image derived from openvsx-server
FROM docker.io/amvanbaren/openvsx-server:c21a6c80
FROM ghcr.io/eclipse/openvsx-server:dbbaff4

COPY --from=builder --chown=openvsx:openvsx /workdir/website/static/ BOOT-INF/classes/static/
COPY --from=builder --chown=openvsx:openvsx /workdir/configuration/ config/
Expand Down
2 changes: 2 additions & 0 deletions configuration/application.yml
Original file line number Diff line number Diff line change
Expand Up @@ -167,3 +167,5 @@ ovsx:
seconds: 300
integrity:
key-pair: create
registry:
version: ${SERVER_VERSION}
6 changes: 6 additions & 0 deletions kubernetes/open-vsx.org.libsonnet
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
local utils = import "utils.libsonnet";

local serverVersion(dockerImage) =
local pieces = std.split(dockerImage, ":");
local lastIndex = std.length(pieces) - 1;
pieces[lastIndex];

local labels(env) = {
app: env.appName,
environment: env.envName,
Expand Down Expand Up @@ -192,6 +197,7 @@ local newDeployment(env, dockerImage) = {
_env:: {
JVM_ARGS: (if (env.envName == "staging") then "-Dspring.datasource.hikari.maximum-pool-size=5 -Xms512M -Xmx1536M" else "-Xms4G -Xmx6G") + jvmPerfOptions,
DEPLOYMENT_CONFIG: "%s/%s" % [ env.deploymentConfig.path, env.deploymentConfig.filename, ],
SERVER_VERSION: serverVersion(dockerImage),
ENVNAME: env.envName
},
envFrom: [
Expand Down
13 changes: 12 additions & 1 deletion website/dev/main-dev.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,18 @@ const App: FunctionComponent = () => {
const themeType = prefersDarkScheme ? 'dark' : 'light';
const theme = useMemo(() => createDefaultTheme(themeType), [themeType]);
const service = new MockRegistryService();
const pageSettings = createPageSettings(theme, prefersDarkScheme);
const getServerVersion = async (): Promise<string> => {
const abortController = new AbortController();
try {
const result = await service.getRegistryVersion(abortController);
return result.version;
} catch (error) {
console.error('Could not determine server version');
return 'unknown';
}
}

const pageSettings = createPageSettings(theme, prefersDarkScheme, getServerVersion());

return (
<HelmetProvider>
Expand Down
6 changes: 5 additions & 1 deletion website/dev/mock-service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
import {
ExtensionRegistryService, SearchResult, ErrorResult, Extension, ExtensionReviewList, SuccessResult,
UserData, ExtensionReview, PersonalAccessToken, CsrfTokenJson, ExtensionReference, Namespace,
NamespaceMembershipList, AdminService, PublisherInfo, NewReview, ExtensionFilter, UrlString, MembershipRole
NamespaceMembershipList, AdminService, PublisherInfo, NewReview, ExtensionFilter, UrlString, MembershipRole, RegistryVersion
} from "openvsx-webui";

const avatarUrl = 'https://upload.wikimedia.org/wikipedia/commons/9/99/Avatar_cupcake.png';
Expand Down Expand Up @@ -146,6 +146,10 @@ export class MockRegistryService extends ExtensionRegistryService {
async signPublisherAgreement(abortController: AbortController): Promise<Readonly<UserData | ErrorResult>> {
return Promise.resolve({} as UserData);
}

async getRegistryVersion(abortController: AbortController): Promise<Readonly<RegistryVersion>> {
return Promise.resolve({version: 'v0.15.0'})
}
}

export class MockAdminService extends AdminService {
Expand Down
2 changes: 1 addition & 1 deletion website/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
"repository": "https://github.com/eclipse/open-vsx.org",
"license": "EPL-2.0",
"dependencies": {
"openvsx-webui": "0.11.5-next.5c0e2e08"
"openvsx-webui": "0.11.6"
},
"peerDependencies": {
"@babel/core": "^7.0.0"
Expand Down
13 changes: 12 additions & 1 deletion website/src/main.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,18 @@ const App: FunctionComponent = () => {
const themeType = prefersDarkScheme ? 'dark' : 'light';
const theme = useMemo(() => createDefaultTheme(themeType), [themeType]);
const service = new ExtensionRegistryService();
const pageSettings = createPageSettings(theme, prefersDarkScheme);
const getServerVersion = async (): Promise<string> => {
const abortController = new AbortController();
try {
const result = await service.getRegistryVersion(abortController);
return result.version;
} catch (error) {
console.error('Could not determine server version');
return 'unknown';
}
}

const pageSettings = createPageSettings(theme, prefersDarkScheme, getServerVersion());

return (
<HelmetProvider>
Expand Down
21 changes: 16 additions & 5 deletions website/src/page-settings.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
* SPDX-License-Identifier: EPL-2.0
********************************************************************************/

import React, { FunctionComponent, ReactNode } from 'react';
import React, { FunctionComponent, ReactNode, Suspense, lazy } from 'react';
import { Link, Typography, Theme, Box, SxProps } from '@mui/material';
import { Helmet, HelmetTags } from 'react-helmet-async';
import { Link as RouteLink, Route, useParams } from 'react-router-dom';
Expand All @@ -23,12 +23,23 @@ import About from './about';
import Adopters from './adopters';
import Members from './members';

export default function createPageSettings(theme: Theme, prefersDarkMode: boolean): PageSettings {
export default function createPageSettings(theme: Theme, prefersDarkMode: boolean, serverVersionPromise: Promise<string>): PageSettings {
//---------- SERVER VERSION
const ServerVersion = lazy(async () => {
const version = await serverVersionPromise;
return { default: () => <Typography variant='body2' sx={{ alignSelf: 'flex-start', fontSize: '0.8rem' }}>{version}</Typography> };
});

//---------- MAIN LOGO / TOOLBAR
const toolbarContent: FunctionComponent = () =>
<RouteLink to={ExtensionListRoutes.MAIN} aria-label={`Home - Open VSX Registry`}>
<OpenVSXLogo width='auto' height='40px' marginTop='8px' prefersDarkMode={prefersDarkMode} />
</RouteLink>;
<>
<RouteLink to={ExtensionListRoutes.MAIN} aria-label={`Home - Open VSX Registry`}>
<OpenVSXLogo width='auto' height='40px' marginTop='8px' prefersDarkMode={prefersDarkMode} />
</RouteLink>
<Suspense>
<ServerVersion/>
</Suspense>
</>;

//---------- ANNOUNCEMENT BANNER
const bannerContent: FunctionComponent = () =>
Expand Down
10 changes: 5 additions & 5 deletions website/yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -2290,7 +2290,7 @@ __metadata:
"@types/react-router-dom": "npm:^5.3.3"
css-loader: "npm:^6.8.1"
express: "npm:^4.18.2"
openvsx-webui: "npm:0.11.5-next.5c0e2e08"
openvsx-webui: "npm:0.11.6"
source-map-loader: "npm:^4.0.1"
style-loader: "npm:^3.3.3"
typescript: "npm:~5.1.6"
Expand All @@ -2311,9 +2311,9 @@ __metadata:
languageName: node
linkType: hard

"openvsx-webui@npm:0.11.5-next.5c0e2e08":
version: 0.11.5-next.5c0e2e08
resolution: "openvsx-webui@npm:0.11.5-next.5c0e2e08"
"openvsx-webui@npm:0.11.6":
version: 0.11.6
resolution: "openvsx-webui@npm:0.11.6"
dependencies:
"@emotion/react": "npm:^11.11.1"
"@emotion/styled": "npm:^11.11.0"
Expand All @@ -2340,7 +2340,7 @@ __metadata:
react-router-dom: "npm:^6.14.1"
peerDependencies:
"@babel/core": ^7.0.0
checksum: 88a5e81ab2653ec93c1ade763b2f1ad3d05025f80e801eb49ccc8273c19775ebaf1a3f4bc798667a7a3b7a83253edfb9b0448e28e4d3872ff332ca6b72543a0e
checksum: 34494026c6c22f57545b41342e79c2bc3a94bb83a0c6a7994c8e75333922bca06eca54b320c61b8de2420dd3ad3ec230fae3187f74c2b276865780def17aafc4
languageName: node
linkType: hard

Expand Down
Loading