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

chore(about): set up links and version parsing for 3.0 #1187

Merged
merged 4 commits into from
Dec 18, 2023
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
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"
}
Loading