-
-
Notifications
You must be signed in to change notification settings - Fork 2
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
Get FLEx model version from repo and store in metadata #1082
base: develop
Are you sure you want to change the base?
Conversation
UI unit Tests12 tests 12 ✅ 0s ⏱️ Results for commit 21d089e. ♻️ This comment has been updated with latest results. |
Haven't added any frontend changes yet, because I'm not certain how we actually want to expose this on the project page. That should probably happen before I actually ask for a code review, so let me withdraw my review request and mark this one as draft. |
7d65f5e
to
3b5ee77
Compare
Regular users won't be shown the model version because it's a little too technical, but project managers (and org & site admins) can see it.
} | ||
catch | ||
{ | ||
if (int.TryParse(text, out var num)) return num; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fallback in case a future FLEx or Chorus update decides to make this a simple text file containing the number instead of JSON. Probably not needed; can remove if you think I should remove it.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah let's remove it as it's planning for something that might never happen
frontend/src/routes/(authenticated)/project/[project_code]/+page.svelte
Outdated
Show resolved
Hide resolved
Converted to draft because requirements just changed: frontend should now present FW version numbers (e.g. 7000068 is FW 8.2, 7000069 is FW 8.3, and so on). Will implement on Monday. |
A list of all unique model versions in all FLEx repos in prod, which took all of 2 minutes 23 seconds to generate (plus a couple more minutes to test the script on staging):
So I won't have very many model versions to put in the table. The project counts for each model version: 58 - 1 project According to the MasterLCModel.xml file in liblcm, the models have the following dates: 17 January 2018 (7000072) Looking through the Git tags for various FieldWorks releases, I find the following dates: 7.2.3: 16 March 2012 (before 58) So I'm going to use the following model - version number table for display purposes: 58 - FW 7.2 |
And show it to everyone instead of just managers.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Reviewed, turns out I forgot some older review comments, sorry they didn't get submitted.
var projectId = await projectService.LookupProjectId(code); | ||
await permissionService.AssertCanManageProject(projectId); | ||
var project = await dbContext.Projects.FindAsync(projectId); | ||
NotFoundException.ThrowIfNull(project); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't think this is needed as we already know the project exists because we were able to find a project ID from the code. Which means we can skip the project query entirely
} | ||
catch | ||
{ | ||
if (int.TryParse(text, out var num)) return num; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah let's remove it as it's planning for something that might never happen
$: fwModel = versionLookupTable[modelVersion] ?? 'Unknown FieldWorks version'; | ||
</script> | ||
|
||
<span class={extraClass}>{fwModel}</span> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I would like a tooltip on this to see the modelVersion
, just using the title
attribute should be fine
@@ -379,6 +389,22 @@ | |||
</AdminContent> | |||
</DetailItem> | |||
{/if} | |||
<!-- Only show model version to project managers and admins, too technical to show to regular members --> | |||
{#if project.type === ProjectType.FlEx} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
your comment doesn't match the condition, is this missing or is the comment no longer valid since it's the flex version?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Removed the check, so I should remove the comment.
Fix #1022.
This PR adds a command to our command runner to extract the FLEx project's model version from the repo and store it in the FlexProjectMetadata table. It also adds a GraphQL mutation to update the model version; that mutation returns the project, so that the frontend calling that mutation can also query
flexProjectMetadata { flexModelVersion }
as part of the mutation results, and get the updated model version in a single step.