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

RSDK-9286 - simplify org-location-machine-part hierarchy #4703

Merged
merged 5 commits into from
Jan 16, 2025

Conversation

stuqdog
Copy link
Member

@stuqdog stuqdog commented Jan 13, 2025

Minimizes the information needed when working with the org/location/machine/part hierarchy. We continue to allow for all information to be passed and indicate as such because the way information is passed alters what's necessary, i.e. passing just part is okay if we pass the part ID, but not if we pass the part name.

As a flyby, updates the way the hierarchy is shared to ensure accuracy. Previously, if we passed just a machine ID and a part ID, we'd list the org and location as the alphabetically first ones even when that wasn't correct.

Tested locally by running commands with minimized information, ensured no change in behavior.

@stuqdog stuqdog requested a review from a team as a code owner January 13, 2025 17:09
@viambot viambot added the safe to test This pull request is marked safe to test from a trusted zone label Jan 13, 2025
@@ -1327,7 +1327,7 @@ var app = &cli.App{
Usage: "removes binary data with file IDs in a single org and location from dataset",
UsageText: createUsageText("dataset data remove",
[]string{datasetFlagDatasetID, generalFlagOrgID, dataFlagLocationID, dataFlagFileIDs}, false),
// TODO(RSDK-9286) do we need to ask for og and location here?
// CR erodkin: we need these because currently the way the Data APIs work, if you don't pass the primary org ID then it won't work correctly and I don't think we can properly infer which one is the "correct" one. We could do something hacky! but probably better to leave this to data to fix, and flag this to reviewers in the meantime.
Flags: []cli.Flag{
Copy link
Member Author

Choose a reason for hiding this comment

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

We continue to ask for and require all of org/location/machine for RemoveDataFromDataset. Per discussion with @dmhilly and @tahiyasalam, the behavior here will change depending on which org ID is passed, and if we pass a secondary org ID instead of the primary owning org ID then data will not be removed correctly.

@viambot viambot added safe to test This pull request is marked safe to test from a trusted zone and removed safe to test This pull request is marked safe to test from a trusted zone labels Jan 13, 2025
@viambot viambot added safe to test This pull request is marked safe to test from a trusted zone and removed safe to test This pull request is marked safe to test from a trusted zone labels Jan 13, 2025
@viambot viambot added safe to test This pull request is marked safe to test from a trusted zone and removed safe to test This pull request is marked safe to test from a trusted zone labels Jan 14, 2025
Copy link
Member

@purplenicole730 purplenicole730 left a comment

Choose a reason for hiding this comment

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

Everything looking good, just have to update the usage text with the new required/unrequired options

cli/app.go Outdated
@@ -1727,8 +1724,14 @@ var app = &cli.App{
Name: "status",
Usage: "display part status",
UsageText: createUsageText("machines part status", []string{generalFlagMachine, generalFlagPart}, true),
Copy link
Member

Choose a reason for hiding this comment

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

if machine is no longer required, this has to be updated. same goes for all the other commands

cli/app.go Outdated
@@ -1888,10 +1877,14 @@ var app = &cli.App{
Usage: "start a shell on a machine part",
Description: `In order to use the shell command, the machine must have a valid shell type service.`,
UsageText: createUsageText(
"machines part shell", []string{generalFlagOrganization, generalFlagLocation, generalFlagMachine, generalFlagPart}, false,
"machines part shell", []string{generalFlagMachine, generalFlagPart}, false,
Copy link
Member

Choose a reason for hiding this comment

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

machine doesn't seem to be required

@viambot viambot added safe to test This pull request is marked safe to test from a trusted zone and removed safe to test This pull request is marked safe to test from a trusted zone labels Jan 15, 2025
@stuqdog stuqdog merged commit 89dbfcb into viamrobotics:main Jan 16, 2025
16 checks passed
@stuqdog stuqdog deleted the simplify-org-location-machine-part branch January 16, 2025 20:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
safe to test This pull request is marked safe to test from a trusted zone
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants