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

Set up CI for bob / rn compatibility matrix and handle non-standard codegen output dirs #163

Merged
merged 28 commits into from
Nov 28, 2024

Conversation

Johennes
Copy link
Collaborator

No description provided.

@jhugman
Copy link
Owner

jhugman commented Nov 14, 2024

Quick drive by, I know it's in draft, just a quick note to say:

This is stunning. It's going to be so helpful. Thank you.

@Johennes Johennes marked this pull request as ready for review November 15, 2024 14:17
@Johennes
Copy link
Collaborator Author

I think this is in a state where it can be reviewed now.

I thought a bit about adding further dimensions to the test matrix such as org-scoped vs. non-org-scoped package name and standard vs. custom codegen output paths. However, these would make the number of combinations and CI jobs soar.

Instead I just used bob version, RN version and platform for the test matrix dimensions and always use an org-scoped package name and custom codegen output paths. The thinking there is that if e.g. the job succeeds with custom codegen paths, it is likely to also succeed with the default ones whereas the opposite is not true.

The jobs currently all fail because of #161.

I would suggest to also run the workflow on PRs (as it is configured right now) but to not make it block the PR. This can be achieved by tweaking the required status checks in the repository settings.

@Johennes Johennes requested a review from jhugman November 15, 2024 14:24
Copy link
Owner

@jhugman jhugman left a comment

Choose a reason for hiding this comment

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

This is really nice. Thank you.

I will let you be the arbiter of ordering you land it in. Getting it all in order with #161 may need the build to break for a little bit, but I'm okay with that.

I thought a bit about adding further dimensions to the test matrix such as org-scoped vs. non-org-scoped package name and standard vs. custom codegen output paths. However, these would make the number of combinations and CI jobs soar.

Yes, agreed. There are some lighter weight checks in test-turbo-modules.sh which might be worth separating out in another PR. These just make sure the identifiers inn the ubrn generated files match those in the builder-bob versions.

@@ -1,4 +1,5 @@
[![CI](https://github.com/jhugman/uniffi-bindgen-react-native/actions/workflows/ci.yml/badge.svg)](https://github.com/jhugman/uniffi-bindgen-react-native/actions/workflows/ci.yml)
[![build-bob compatibility](https://github.com/jhugman/uniffi-bindgen-react-native/actions/workflows/compat.yml/badge.svg)](https://github.com/jhugman/uniffi-bindgen-react-native/actions/workflows/compat.yml)
Copy link
Owner

Choose a reason for hiding this comment

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

😻

error "No available iOS simulator found"
fi

xcodebuild -workspace "${IOS_NAME}Example.xcworkspace" -scheme "${IOS_NAME}Example" -configuration Debug -destination "id=$udid" || error "Failed to build iOS example"
Copy link
Owner

Choose a reason for hiding this comment

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

Oh, I see how you're getting rid of IOS_NAME now.

if [ -f "$PKG_JSON_MIXIN" ] ; then
jq -s '.[0] * .[1]' ./package.json "$PKG_JSON_MIXIN" > ./package.json.new
mv ./package.json.new ./package.json
fi
Copy link
Owner

Choose a reason for hiding this comment

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

Neat.

scripts/test-turbo-modules.sh Outdated Show resolved Hide resolved
Comment on lines +19 to +25
bob-version:
- 0.42.2
- 0.42.3
- latest
rn-version:
- 0.76.0
- latest
Copy link
Owner

Choose a reason for hiding this comment

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

I love this.

.github/workflows/compat.yml Outdated Show resolved Hide resolved
@Johennes
Copy link
Collaborator Author

I will let you be the arbiter of ordering you land it in. Getting it all in order with #161 may need the build to break for a little bit, but I'm okay with that.

Thanks. I guess since this is fairly well isolated, I'll let it sit for a while in hopes that I can figure out #165 and then merge both together.

fn default() -> Self {
Self {
ios: default_ios_codegen_output_dir(),
android: default_android_codegen_output_dir(),
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

It feels slightly awkward having to pass in the default values here and in the serde macros. But I think we need to do it this way to account for either the whole object missing or only one of its fields?

@Johennes Johennes requested a review from jhugman November 26, 2024 12:44
@Johennes
Copy link
Collaborator Author

@jhugman I've merged the other PR into this one after addressing your feedback from there. Sorry for the multi-PR spam. 🙈

@Johennes
Copy link
Collaborator Author

Hm, I'm unsure why the integration tests are failing now. 🤔

Running fixture coverall2
Running cd "/home/runner/work/uniffi-bindgen-react-native/uniffi-bindgen-react-native/fixtures/coverall2/tests/bindings" && "/home/runner/work/uniffi-bindgen-react-native/uniffi-bindgen-react-native/node_modules/.bin/tsc" "--outdir" "/home/runner/work/uniffi-bindgen-react-native/uniffi-bindgen-react-native/build/js/tsc/test_coverall2"
test_coverall2.ts(120,49): error TS2554: Expected 0-1 arguments, but got 3.

It's failing on this line but I haven't actually touched that part.

https://github.com/jhugman/uniffi-bindgen-react-native/blob/main/fixtures/coverall2/tests/bindings/test_coverall2.ts#L120

Copy link
Owner

@jhugman jhugman left a comment

Choose a reason for hiding this comment

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

I think if you land this now and we can fix #167 separately.

Good work, @Johennes this is a really helpful PR.

@Johennes Johennes changed the title Set up CI for bob / rn compatibility matrix Set up CI for bob / rn compatibility matrix and handle non-standard codegen output dirs Nov 28, 2024
@Johennes Johennes merged commit 2d0e12c into main Nov 28, 2024
16 of 17 checks passed
@Johennes Johennes deleted the johannes/compatibility-matrix branch November 28, 2024 07:04
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.

2 participants