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

APP-7267 APP-7269 Add version support to GetFragment #610

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
29 changes: 29 additions & 0 deletions proto/viam/app/v1/app.proto
Original file line number Diff line number Diff line change
Expand Up @@ -190,6 +190,9 @@ service AppService {
// Gets a single fragment
rpc GetFragment(GetFragmentRequest) returns (GetFragmentResponse);

// Gets usage for a fragment across versions
rpc GetFragmentUsage(GetFragmentUsageRequest) returns (GetFragmentUsageResponse);

// Creates a fragment
rpc CreateFragment(CreateFragmentRequest) returns (CreateFragmentResponse);

Expand Down Expand Up @@ -813,6 +816,7 @@ message Fragment {
FragmentVisibility visibility = 12;
// latest timestamp when fragment was updated
google.protobuf.Timestamp last_updated = 13 [(tagger.v1.tags) = "bson:\"last_updated_at\""];
string revision = 14;
}

message FragmentHistoryEntry {
Expand All @@ -822,6 +826,18 @@ message FragmentHistoryEntry {
AuthenticatorInfo edited_by = 4 [(tagger.v1.tags) = "bson:\"edited_by\" json:\"edited_by\""];
}

message FragmentRevision {
string revision = 1;
google.protobuf.Timestamp created_at = 2;
}

message FragmentTag {
string tag = 1;
string revision = 2;
google.protobuf.Timestamp created_at = 3;
google.protobuf.Timestamp updated_at = 4;
Copy link
Member

Choose a reason for hiding this comment

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

UI is not using these fields in latest design; given there's some quirks around trying to store this data, let's ditch it from the response

}

enum FragmentVisibility {
FRAGMENT_VISIBILITY_UNSPECIFIED = 0;
FRAGMENT_VISIBILITY_PRIVATE = 1;
Expand All @@ -843,11 +859,13 @@ enum FragmentErrorType {
FRAGMENT_ERROR_TYPE_CYCLE_DETECTED = 4;
}

// Cached fragment usage statistics
Copy link
Member

@anjinai anjinai Jan 9, 2025

Choose a reason for hiding this comment

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

Do we want to add a comment here about how this will either be tag usages or revision usages?

Copy link
Member Author

Choose a reason for hiding this comment

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

updated!

message FragmentUsage {
string fragment_id = 1;
int32 organizations = 2;
int32 machines = 3;
int32 machines_in_current_org = 4;
string version = 5;
Copy link
Member Author

@ehhong ehhong Jan 9, 2025

Choose a reason for hiding this comment

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

should this be optional? or should we establish "" as "aggregate fragment usage stats"

Copy link
Member

Choose a reason for hiding this comment

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

I like optional for intent a little more

Copy link
Member

Choose a reason for hiding this comment

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

+1 to optional.

}

message ResolvedFragment {
Expand All @@ -870,11 +888,22 @@ message ListFragmentsResponse {
message GetFragmentRequest {
string id = 1;
string current_organization_id = 2;
optional string version = 3;
}

message GetFragmentResponse {
Fragment fragment = 1;
FragmentUsage fragment_usage = 2;
repeated FragmentRevision revisions = 3;
ehhong marked this conversation as resolved.
Show resolved Hide resolved
repeated FragmentTag tags = 4;
}

message GetFragmentUsageRequest {
string fragment_id = 1;
}

message GetFragmentUsageResponse {
repeated FragmentUsage version_usages = 1;
}

message CreateFragmentRequest {
Expand Down
Loading