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

RBS improvements #174

Merged
merged 35 commits into from
Mar 26, 2024
Merged

RBS improvements #174

merged 35 commits into from
Mar 26, 2024

Conversation

mullermp
Copy link
Contributor

@mullermp mullermp commented Mar 7, 2024

Fixes #172

@ksss ksss mentioned this pull request Mar 8, 2024
Comment on lines +4 to +6
CI_HEARTH_PATH = "../hearth/sig"
PROJECTIONS_HEARTH_PATH = "../../../hearth/sig"
HEART_SIG_DIR = Dir.exist?(CI_HEARTH_PATH) ? CI_HEARTH_PATH : PROJECTIONS_HEARTH_PATH
Copy link
Contributor Author

Choose a reason for hiding this comment

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

What about using ENV variables from CI instead? Or "working directory" in CI and use the current dir (preferred)?

@@ -0,0 +1,30 @@
require 'rubygems'
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Should this Rakefile actually live in the main repo root and be copied into projections if needed? Similar to how v3 repo is setup.

Copy link
Contributor

Choose a reason for hiding this comment

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

I'm not sure - its specific to whitelabel (in namespace)

codegen/projections/white_label/spec/types_spec.rb Outdated Show resolved Hide resolved
@@ -1,5 +1,6 @@
# frozen_string_literal: true

# Used to test endpoint and other models from Smithy
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Possibly RBS test definition can be here? IDK

Copy link
Contributor

Choose a reason for hiding this comment

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

I dont think so - this works on a different context. We could jam it together, we just would then need to make sure to never run these tests from the whitelabel. And vice-versa.

Copy link
Contributor

Choose a reason for hiding this comment

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

RE: All of the rakefile comments - I'll take a broader look at what we can do here in a new PR. I think we need to throw all of our existing CI away and redo it if we want a more unified, single Rakefile

@@ -0,0 +1,30 @@
require 'rubygems'
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Ditto on Rakefile comment - shouldn't we just copy it like we do Steepfile etc? This seems duplicative.

Copy link
Contributor

@alextwoods alextwoods Mar 26, 2024

Choose a reason for hiding this comment

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

We do just copy this rakefile - I added a new task in the build that copies it (right after the steepfile gets copied).

.definitionFile(DEFAULT_DEFINITION_FILE).build();
}

@Override
public Symbol unionShape(UnionShape shape) {
String name = getDefaultShapeName(shape, "Union__");
return createSymbolBuilder(shape, name, name, name, moduleName)
return createSymbolBuilder(shape, name, "Types::" + name, name, moduleName)
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Is this correct? Some times we may not want to print out a full qualified name. I would assume it's relative to where it's being written.

Copy link
Contributor

@alextwoods alextwoods Mar 26, 2024

Choose a reason for hiding this comment

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

Yeah - I was debating this. The rbsType property doesn't have the same namespace sensitive ability as the actual symbol name. I think Types::<name> will always be correct (it just may be more information than necessary if you use it within the types module).
Edit: I've confirmed that these types in the generated types.rbs still work correctly (and pass validation).

@mullermp mullermp merged commit 32b1078 into main Mar 26, 2024
27 checks passed
@mullermp mullermp deleted the rbs-improve branch March 26, 2024 17:16
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.

RBS improvements
2 participants