-
Notifications
You must be signed in to change notification settings - Fork 42
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
System Update API #2100
Merged
Merged
System Update API #2100
Changes from 6 commits
Commits
Show all changes
50 commits
Select commit
Hold shift + click to select a range
b7b60c0
stub system update status, list, and detail
david-crespo 9a5ae8c
wrap semver::Version and impl JsonSchema for it
david-crespo 468a263
/components endpoints for update detail and system version, tweak names
david-crespo 1ce8ae6
add update start and stop without deciding what their responses are
david-crespo 9d86f52
move AssetIdentityMetadata next to Asset, add identity() method
david-crespo 24ab40c
add system updates table
david-crespo cde4429
stub integration tests for stubbed endpoints
david-crespo 859605c
so damn close with the component join table but it doesn't compile
david-crespo e3e3123
thanks @smklein
david-crespo 4eed1d7
update openapi spec, fix nexus method name
david-crespo afe32c1
Merge branch 'main' into stub-update-api
david-crespo 186994e
paginate list of updates
david-crespo ea4bbde
implement to/from sql for semver version
david-crespo 38e3444
Merge branch 'main' into stub-update-api
david-crespo dea5ada
fix VersionStatus enum in openapi spec with serde tag
david-crespo a7d898c
use list of component types from RFD 300
david-crespo 54e1f45
updateable components table (TODO: status and reason)
david-crespo 34ebe77
nexus method to create a system update + test for it
david-crespo 4c59334
create_component_update() and working test
david-crespo 7aa207c
other system update should not be associated with any component updates
david-crespo b9ac8b6
create updateable component, test for it
david-crespo c143f8a
make the unauthorized things pass, mediocrely
david-crespo c6f9dff
update iam roles policy test and nexus_tags.txt
david-crespo 78e3fb7
make existing system update refresh endpoint match the rest
david-crespo 8ffa99a
Merge branch 'main' into stub-update-api
david-crespo 1eeaf4e
make version the PK of the system update, fetch by version instead of id
david-crespo c5b6264
remove id from system_update. horrible because it goes against the grain
david-crespo ffea521
Revert "remove id from system_update. horrible because it goes agains…
david-crespo 190af7c
change comment: we're not getting rid of the ID. update openapi spec
david-crespo fde6e98
clean up around TODO comments, add SystemUpdateDeployment view, fix t…
david-crespo 3ef6f38
can't give the params the same name as the view
david-crespo f8898a8
Merge branch 'main' into stub-update-api
david-crespo c145d60
Merge branch 'main' into stub-update-api
david-crespo 2660a52
add update deployments table and list/view endpoints
david-crespo b3df99c
Merge main into stub-update-api
david-crespo 9ec0773
fix clippy and tests
david-crespo e992960
Merge branch 'main' into stub-update-api
david-crespo 3dc2bb0
plumb through UpdateStatus, SystemUpdateDeployment -> UpdateDeployment
david-crespo 0746adf
version_sort column that lets us sort by version
david-crespo 5a2b99f
validate that semver version has low enough numbers for our sort hack
david-crespo a28b371
add version_sort to updateable_component so we can get low/high for s…
david-crespo 0d22dd0
better test to prove we're not doing normal string sort on versions
david-crespo 53d7d03
component tree and component update tree are no longer trees
david-crespo 07dea02
use a transaction, working integration test for system version endpoint
david-crespo 05635bd
put verb first in nexus function names
david-crespo 9575587
create_update_deployment (doesn't check if we're already updating)
david-crespo 6cdfe40
fix ON CONFLICT by not doing that. add tests for version conflicts
david-crespo b7a0b93
change system update pk back to ID, exempt /system/version from auth …
david-crespo a1772af
updateable component should have both own version and system version
david-crespo f109cfe
don't blame buildomat. look inward
david-crespo 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
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
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
use crate::schema::system_update; | ||
use db_macros::Asset; | ||
use nexus_types::{external_api::views, identity::Asset}; | ||
use serde::{Deserialize, Serialize}; | ||
|
||
#[derive( | ||
Queryable, | ||
Insertable, | ||
Selectable, | ||
Clone, | ||
Debug, | ||
Asset, | ||
Serialize, | ||
Deserialize, | ||
)] | ||
#[diesel(table_name = system_update)] | ||
pub struct SystemUpdate { | ||
#[diesel(embed)] | ||
identity: SystemUpdateIdentity, | ||
pub version: String, | ||
} | ||
|
||
impl From<SystemUpdate> for views::SystemUpdate { | ||
fn from(system_update: SystemUpdate) -> Self { | ||
Self { | ||
identity: system_update.identity(), | ||
// TODO: figure out how to ser/de semver versions | ||
// version: system_update.version, | ||
version: views::SemverVersion::new(1, 0, 0), | ||
} | ||
} | ||
} |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -963,6 +963,14 @@ authz_resource! { | |
polar_snippet = FleetChild, | ||
} | ||
|
||
authz_resource! { | ||
name = "SystemUpdate", | ||
parent = "Fleet", | ||
primary_key = Uuid, | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. just noticed this is wrong if version is the pk |
||
roles_allowed = false, | ||
polar_snippet = FleetChild, | ||
} | ||
|
||
authz_resource! { | ||
name = "GlobalImage", | ||
parent = "Fleet", | ||
|
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.
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.
This comment was marked as resolved.
Sorry, something went wrong.