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

SDK, reorganize mod structure for clarity #4749

Merged
merged 13 commits into from
Feb 6, 2024
Merged

Conversation

jul-sh
Copy link
Contributor

@jul-sh jul-sh commented Feb 2, 2024

Moves a couple of utility functions from the root level into a pub channel and utils mod. Should make the docs a lot easier to read. Also aligns the crate file structure with its pub interface for clarity.

The diff is a bit misleading, but code has only been moved between files, not written anew.

This is technically a breaking change, but all moved functions are very new, and I don't expect teams to already be depending on them. And if they are, the compiler error message should make migration not too difficult.

Moves a couple of utility functions from the root level into a pub channel and utils mod. Should make the docs a lot easier to read. Also aligns the crate file structure with its pub interface for clarity.

This is technically a breaking change, but all moved functions are very new, and I don't expect teams to already be depending on them. And if they are, the compiler error message should make migration not too difficult.
@andrisaar
Copy link
Collaborator

Proposal: move all the mock attestation related stuff into mock_attestation.rs or something like that.

This would leave the root lib.rs much cleaner, and mean you'd only have to tag mod mock_attestation with the feature gate.

(Honestly I'd probably move all the non-mock stuff to a different file as well, keeping only the interfaces in the root lib.rs file.)

oak_restricted_kernel_sdk/src/lib.rs Outdated Show resolved Hide resolved
@tiziano88
Copy link
Collaborator

Proposal: move all the mock attestation related stuff into mock_attestation.rs or something like that.

This would leave the root lib.rs much cleaner, and mean you'd only have to tag mod mock_attestation with the feature gate.

(Honestly I'd probably move all the non-mock stuff to a different file as well, keeping only the interfaces in the root lib.rs file.)

+1 all the mock stuff is quite invasive at the moment, a sub module may make that tidier

oak_core/src/samplestore.rs Outdated Show resolved Hide resolved
@jul-sh
Copy link
Contributor Author

jul-sh commented Feb 5, 2024

I've moved the attestation structs to instance_attestation and mock_attestation submodules respectively. I agree it makes the crate a lot more readable.

@tiziano88 @ipetr0v What do you both think? Imo this seems nice, but then the struct naming becomes a bit redundant.

eg:

oak_restricted_kernel_sdk::mock_attestation::MockEvidenceProvider,

etc. Should we shorten the struct names? (imo probs yes). Should instead we keep it all in one mod? Many choices.

@ipetr0v
Copy link
Contributor

ipetr0v commented Feb 5, 2024

I've moved the attestation structs to instance_attestation and mock_attestation submodules respectively. I agree it makes the crate a lot more readable.

@tiziano88 @ipetr0v What do you both think? Imo this seems nice, but then the struct naming becomes a bit redundant.

eg:

oak_restricted_kernel_sdk::mock_attestation::MockEvidenceProvider,

etc. Should we shorten the struct names? (imo probs yes). Should instead we keep it all in one mod? Many choices.

I don't think we'll ever have a Group Attestation, so the instance attestation name may be confusing. So maybe just attestation?

Also I think MockAttestation also be moved to tests or testing, since it will only used for tests.

@jul-sh
Copy link
Contributor Author

jul-sh commented Feb 5, 2024

I don't think we'll ever have a Group Attestation, so the instance attestation name may be confusing. So maybe just attestation?

Idk, seems possible we may want that at some point

Also I think MockAttestation also be moved to tests or testing, since it will only used for tests.

like public testing module? It needs to be public, since it's exported for to be used by other crates in their tests

@jul-sh jul-sh merged commit bf694d8 into project-oak:main Feb 6, 2024
17 checks passed
@jul-sh jul-sh deleted the sdk-mods branch February 6, 2024 18:50
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.

5 participants