-
Notifications
You must be signed in to change notification settings - Fork 15
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
Bai 1111 allow semver matching and latest semver for releases #1582
Merged
IR96334
merged 36 commits into
main
from
BAI-1111-allow-semver-matching-and-latest-semver-for-releases
Dec 6, 2024
Merged
Changes from all commits
Commits
Show all changes
36 commits
Select commit
Hold shift + click to select a range
3ad2e86
Can now receive one release by string comparison in mongoose query
IR96334 1c421d7
Added basic semver range check, getters and setters for release semve…
IR96334 9e10ab3
Add series of queries for different types
IR96334 ae35fc8
Added @types/semver, small modifications to range query
IR96334 82bb578
Now plugs into releases endpoint instead of singular release.
IR96334 2d8b532
Changed package name
IR96334 a7b05b8
Simplified and grouped functionality. Also added primitive hyphen ran…
IR96334 725eb87
Fixed caret query
IR96334 da9110c
Added comments for each range query type for explanation
IR96334 6df897e
Added migrations script and updated schema getter to allow for migrat…
IR96334 d050140
Refactor
IR96334 1e56d7b
Bugfixed refactor, removed old code
IR96334 ce0f95e
merge main branch
IR96334 8e7f254
change as per PR
IR96334 235f1f3
Simplified code and added functionality for more queries
IR96334 47106bd
Simplified queries massively, now no longer overwrites previous query
IR96334 ffc7b03
Simplified queries further, added queryboundinterface and queue
IR96334 0215e0e
Removed unnecessary comments
IR96334 3915659
PR changes and added tests
IR96334 b5658be
Small test change
IR96334 f2ff99f
Test changes
IR96334 9604ff1
Trying fix for python tests
IR96334 f532454
Fixed smtp tests
IR96334 223dbad
Merge branch 'main' into BAI-1111-allow-semver-matching-and-latest-se…
IR96334 fcf9a0a
Fix for smtp error
IR96334 0bc56a7
Changed host to local
IR96334 84dfdac
Added mock avScanning config
ARADDCC012 9f6eb68
Updated smtp unit test mock config
ARADDCC012 d15fe16
Updated avScanning mock config ports
ARADDCC012 0546f95
Moved smtp test config into global mock config
ARADDCC012 5118315
Changed name of migration script
IR96334 ae80725
Changes to testing
IR96334 8f31592
Added more changes as per PR
IR96334 f8ca356
Removed error
IR96334 d6f486f
Fixed tests, mocking, added tests, and adjsuted getModelReleases
IR96334 8d0cb76
Fixed release query functionality
IR96334 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
16 changes: 16 additions & 0 deletions
16
backend/src/migrations/012_convert_semver_string_to_object.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
import Release from '../models/Release.js' | ||
|
||
export async function up() { | ||
const releases = await Release.find({}) | ||
for (const release of releases) { | ||
const semver = release.get('semver') | ||
if (semver !== undefined && typeof semver === typeof '') { | ||
release.set('semver', semver) | ||
await release.save() | ||
} | ||
} | ||
} | ||
|
||
export async function down() { | ||
/* NOOP */ | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
When an if statement becomes this complex it's always worth seeing if it could be simplified.
Have you considered:
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.
Done, still required some if statements as expressionA can be the upperSemver as the lower/upper parts of the variables state wether they are upper or lower bounds, not first or second in query