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

Ignores RestorePurchasesDialog previews using IgnoreEmergeSnapshot #2116

Merged
merged 7 commits into from
Feb 7, 2025

Conversation

vegaro
Copy link
Contributor

@vegaro vegaro commented Feb 4, 2025

There's an issue in Emerge Snapshots when previewing a Dialog EmergeTools/emerge-android#136

They've suggested we ignore the snapshot for now. Added the dependency as compileOnly so it doesn't get included in the aar

@vegaro vegaro added the pr:other label Feb 4, 2025
@vegaro vegaro requested review from tonidero and JayShortway and removed request for tonidero February 4, 2025 19:39
@@ -56,6 +56,8 @@ android {
}

dependencies {
compileOnly libs.emerge.snapshots.annotations
Copy link
Contributor Author

@vegaro vegaro Feb 4, 2025

Choose a reason for hiding this comment

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

Does this make sense at all? I see it's making the tests fail to compile

Copy link
Contributor

Choose a reason for hiding this comment

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

Hmm in the docs, it seems they say to use debugImplementation... but that's weird, since it wouldn't work on release I guess? https://docs.emergetools.com/docs/excluding-previews

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Oh interesting, I stopped at "You'll need to include this as an implementation dependency in whatever soruce set you're intending to ignore snapshots." lol

Yeah, with debug, it won't be able to compile on release

Copy link
Contributor Author

Choose a reason for hiding this comment

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

It says "Previews are only included in debug builds". Maybe it just magically works

Copy link
Contributor Author

Choose a reason for hiding this comment

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

weird, as soon as I add it

Caused by: com.vanniktech.maven.publish.MissingVariantException: Invalid MavenPublish Configuration. Unable to find variant to publish named defaultsRelease. Try setting the 'androidVariantToPublish' property in the mavenPublish extension object to something that matches the variant that ought to be published.

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've thought of copying the annotation under the same package to our repo? Is that too crazy?

Copy link
Member

Choose a reason for hiding this comment

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

What's the error when using compileOnly? I think if we use compileOnly in revenuecatui, we should also add it as debugImplementation to the testpurchasesuiandroidcompatibility app.

Copy link
Contributor Author

@vegaro vegaro Feb 6, 2025

Choose a reason for hiding this comment

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

Doing that leads to this, which is very strange to me:

Caused by: com.vanniktech.maven.publish.MissingVariantException: Invalid MavenPublish Configuration. Unable to find variant to publish named defaultsRelease. Try setting the 'androidVariantToPublish' property in the mavenPublish extension object to something that matches the variant that ought to be published.

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 think that's just covering the real issue

Copy link
Contributor Author

Choose a reason for hiding this comment

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

for the future, the error was stupid and I had not commited the change to the toml file

@vegaro vegaro marked this pull request as draft February 4, 2025 20:11
Copy link

emerge-tools bot commented Feb 7, 2025

📸 Snapshot Test

189 unchanged

Name Added Removed Modified Renamed Unchanged Errored Approval
TestPurchasesUIAndroidCompatibility
com.revenuecat.testpurchasesuiandroidcompatibility
0 0 0 0 189 0 N/A

🛸 Powered by Emerge Tools

@vegaro vegaro requested a review from tonidero February 7, 2025 10:18
@vegaro vegaro marked this pull request as ready for review February 7, 2025 10:18
Copy link
Member

@JayShortway JayShortway left a comment

Choose a reason for hiding this comment

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

Let's go! This will finally turn main green again 😄

@vegaro vegaro enabled auto-merge (squash) February 7, 2025 10:26
@vegaro vegaro merged commit eb4f77d into main Feb 7, 2025
10 checks passed
@vegaro vegaro deleted the fix-snapshots branch February 7, 2025 10:41
Copy link

codecov bot commented Feb 7, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 80.89%. Comparing base (a34a420) to head (6184d8b).
Report is 9 commits behind head on main.

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #2116   +/-   ##
=======================================
  Coverage   80.89%   80.89%           
=======================================
  Files         272      272           
  Lines        9047     9047           
  Branches     1276     1276           
=======================================
  Hits         7319     7319           
  Misses       1193     1193           
  Partials      535      535           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants