Skip to content

Conversation

@arsenetar
Copy link
Contributor

Initial version, may have slight addition needed to AssetParameters to fully implement.

Also fixed issue with no longer using the provided protoc for js (system protoc may be a broken version).

@arsenetar arsenetar requested a review from wbrown October 11, 2022 20:33
Copy link
Contributor

@palp palp left a comment

Choose a reason for hiding this comment

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

Some consideration needs to be given to the way the protoc binary is used, but it's not blocking this from being merged.

set(NODE_BIN_DIRECTORY "${PROJECT_SOURCE_DIR}/node_modules/.bin")

set(javascript_exec "protoc")
set(javascript_exec "${PROJECT_SOURCE_DIR}/src/bin/protoc")
Copy link
Contributor

Choose a reason for hiding this comment

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

This could cause the docker build to fail in the future, as well as failing on other platforms; I think it should either use a variable to point to protoc directly so that can be overridden by the build, or we should copy the binary to this location during the docker build.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

The binary is actually already in that location, and the docker build works, other platforms could be an issue as it is a linux amd64 binary. This is just putting this back in a state that actually works, as without it some systems (like mine) have a system protoc version that is not able to be used for TS/JS generation.

I would prefer us to not be building the proto definitions manually most of the time anyhow and relying on Actions here to build them as it provides a more controlled environment.

Copy link
Contributor

Choose a reason for hiding this comment

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

Yeah, I'm aware it'll work fine in most scenarios, which is why I'm fine with this being merged as is - just wanted to make a note.

Copy link
Contributor

@wbrown wbrown left a comment

Choose a reason for hiding this comment

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

Some general ideas and feedback.

}

// Message for empty requests / response where no additional data is needed
message ProjectEmpty {
Copy link
Contributor

Choose a reason for hiding this comment

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

What I've found useful is to return the data structure being deleted, but with a deleted status to communicate that X was deleted.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I don't have any issue with returning it.

}

message Project {
uint64 id = 1; // ID of the project
Copy link
Contributor

Choose a reason for hiding this comment

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

suggest an uuid v4 and translating that to a binary lookup on the db/backend side.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

If we use a UUID here, then we should be using across the board for these in my opinion no reason to translate UUID to ID.

- Change project id to UUIDv4 instead of uint64
- Change asset id to UUIDv4 instead of uint64
- Rename `owner` to `owner_id` for project to be more clear
- Add undefined usage to `ProjectAssetUse`
- Add deleted status to `ProjectStatus`
- Update `Delete` rpc to return project
- Add `uuid` and `size` to artifact
- Add enumeration for asset usage to generation.proto to mirror that of
  the usage enum in project.proto, current files have some issues with
  importing / sharing proto definitions.
- Add asset usage to `AssetParameters`
- Regenerate files
@arsenetar arsenetar requested a review from wbrown October 18, 2022 15:49
@wbrown
Copy link
Contributor

wbrown commented Oct 19, 2022

@arsenetar I'm ok with making the id bytes, as it makes the UUIDv4 more compact if we store it in a binary form. But the caveat here is that string uuidv4's are easier for people to deal with.

@sonarqubecloud
Copy link

Kudos, SonarCloud Quality Gate passed!    Quality Gate passed

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 0 Code Smells

No Coverage information No Coverage information
No Duplication information No Duplication information

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.

4 participants