Skip to content

Commit

Permalink
chore(about): set up links and version parsing for 3.0 (#1187)
Browse files Browse the repository at this point in the history
  • Loading branch information
andrewazores authored Dec 18, 2023
1 parent c8fbeb8 commit b3b0445
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 12 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "cryostat-web",
"version": "2.5.0-dev",
"version": "3.0.0-dev",
"description": "Web-Client for Cryostat",
"repository": "https://github.com/cryostatio/cryostat-web.git",
"license": "Apache-2.0",
Expand Down
14 changes: 9 additions & 5 deletions src/app/About/AboutDescription.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -36,25 +36,29 @@ export const AboutDescription: React.FC = () => {
if (!cryostatVersion) {
return;
}
const expr = /^(?<describe>[a-zA-Z0-9-_.]+-[0-9]+-[a-z0-9]+)(?:-dirty)?$/;
const expr = /^(?<tag>v[0-9]+\.[0-9]+\.[0-9]+)(?:-snapshot)?$/;
const result = cryostatVersion.match(expr);
if (!result) {
notificationsContext.warning(
'Cryostat Version Parse Failure',
`Could not parse Cryostat version string '${cryostatVersion}'.`,
);
return 'main';
return;
}
return result.groups?.describe || 'main';
return result.groups?.tag;
}, [cryostatVersion, notificationsContext]);

const versionComponent = React.useMemo(() => {
if (build.commitHashUrl) {
if (build.releaseTagUrl) {
return (
<Text
component={TextVariants.a}
target="_blank"
href={build.commitHashUrl.replace('__REPLACE_HASH__', cryostatCommitHash || '')}
href={
cryostatCommitHash
? build.releaseTagUrl.replace('__REPLACE_HASH__', cryostatCommitHash)
: build.developmentUrl
}
>
{cryostatVersion}
</Text>
Expand Down
13 changes: 7 additions & 6 deletions src/app/build.json
Original file line number Diff line number Diff line change
@@ -1,16 +1,17 @@
{
"productName": "Cryostat",
"commitHashUrl": "https://github.com/cryostatio/cryostat/commits/__REPLACE_HASH__",
"developmentUrl": "https://github.com/cryostatio/cryostat3",
"releaseTagUrl": "https://github.com/cryostatio/cryostat3/releases/tag/__REPLACE_HASH__",
"homePageUrl": "https://cryostat.io",
"blogPageUrl": "https://cryostat.io/blog",
"documentationUrl": "https://cryostat.io/guides",
"automatedRulesGuideUrl": "https://cryostat.io/guides/#create-an-automated-rule",
"dashboardGuideUrl": "https://cryostat.io/guides/#dashboard",
"discussionUrl": "https://github.com/cryostatio/cryostat/discussions",
"knownIssuesUrl": "https://github.com/cryostatio/cryostat/issues",
"fileIssueUrl": "https://github.com/cryostatio/cryostat/issues/new?labels=user+report,bug&body=Affects+__REPLACE_VERSION__",
"discussionUrl": "https://github.com/cryostatio/cryostat3/discussions",
"knownIssuesUrl": "https://github.com/cryostatio/cryostat3/issues",
"fileIssueUrl": "https://github.com/cryostatio/cryostat3/issues/new?labels=user+report,bug&body=Affects+__REPLACE_VERSION__",
"mailingListName": "Google Groups",
"mailingListUrl": "https://groups.google.com/g/cryostat-development",
"licenseUrl": "https://github.com/cryostatio/cryostat/blob/main/LICENSE.txt",
"version": "2.5.0-dev"
"licenseUrl": "https://github.com/cryostatio/cryostat3/blob/main/LICENSE.txt",
"version": "3.0.0-dev"
}

0 comments on commit b3b0445

Please sign in to comment.