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

Persist version strings in database #804

Merged
merged 1 commit into from
Oct 4, 2023
Merged

Conversation

alflennik
Copy link
Contributor

Closes #763. We recently added "version strings" which are short textual representations of the date a test plan was edited. For example a test plan version updated on March 1 would be represented as "V23.03.01".

However, as of yet we have not accounted for the case that multiple updates occurred to a test plan on the same day, in which case two different versions would have an identical version string.

We decided to add a "1" (or "2" etc.) to the second version string. So the version strings would be "V23.03.01" and "V23.03.01-1".

When @mcking65 proposed the solution, he suggested using a underscore. For whatever reason, I found a hyphen looks noticeably better. It bugs me because I can't really articulate why. It just does. So I went with a hyphen. I'd be willing to go back to an underscore if that's a problem.

This ended up being a pretty invasive change because we previously generated the version strings with a small snippet of code wherever they were needed. Now we will generate the strings when the test plan versions are created and store them in the database.

Copy link
Contributor

@stalgiag stalgiag left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Tested and working well. I really like how you handled the migration and also the decision to continue using updatedAt for sorting while using versionString for presentation.

ORDER BY directory, "updatedAt", id
`,
{ transaction }
);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Love the presorting here to make the loop cleaner below.

@@ -4,6 +4,7 @@
{
"name": "Import tests",
"program": "${workspaceFolder}/server/scripts/import-tests/index.js",
// "args": ["-c","5fe7afd82fe51c185b8661276105190a59d47322"],
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not sure what this is.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for highlighting this, it does look like commented code I forgot to remove 😜 But actually I left it in intentionally because I think it will be useful.

The launch.json enables us to use the VSCode launcher to debug the script that imports the tests from the ARIA-AT repo. However it wasn't very clear how to import a specific commit, which is something we do when creating test environments. This commented code will be useful to anyone who needs to debug the import of a specific commit.

@alflennik alflennik merged commit 643649a into main Oct 4, 2023
@alflennik alflennik deleted the persist-version-string branch October 4, 2023 20:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Clashing version string titles
2 participants