-
Notifications
You must be signed in to change notification settings - Fork 20
chore: move example to examples directory #210
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
Conversation
Codecov Report✅ All modified and coverable lines are covered by tests. ❌ Your project status has failed because the head coverage (35.19%) is below the target coverage (80.00%). You can increase the head coverage or adjust the target coverage. Additional details and impacted files@@ Coverage Diff @@
## main #210 +/- ##
=========================================
Coverage 35.19% 35.19%
Complexity 1071 1071
=========================================
Files 187 187
Lines 7087 7087
Branches 803 803
=========================================
Hits 2494 2494
Misses 4483 4483
Partials 110 110 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
WalkthroughUpdated Dependabot Gradle path, removed an example README, adjusted Makefile targets to run from repo root, upgraded Gradle wrapper version, and reformatted comments/line breaks in a Java example without changing behavior. Changes
Estimated code review effort🎯 2 (Simple) | ⏱️ ~10 minutes Tip 🔌 Remote MCP (Model Context Protocol) integration is now available!Pro plan users can now connect to remote MCP servers from the Integrations page. Connect with popular remote MCPs such as Notion and Linear to add more context to your reviews and chats. ✨ Finishing Touches
🧪 Generate unit tests
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. 🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
SupportNeed help? Create a ticket on our support page for assistance with any issues or questions. CodeRabbit Commands (Invoked using PR/Issue comments)Type Other keywords and placeholders
CodeRabbit Configuration File (
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 0
🧹 Nitpick comments (4)
examples/basic-examples/gradle/wrapper/gradle-wrapper.properties (1)
3-3
: Use the “bin” distribution and pin the SHA-256 checksumSwitching from
-all
to-bin
cuts down CI download size, and addingdistributionSha256Sum
hardens your supply chain.• Update examples/basic-examples/gradle/wrapper/gradle-wrapper.properties:
- distributionUrl=https\://services.gradle.org/distributions/gradle-8.2.1-all.zip + distributionUrl=https\://services.gradle.org/distributions/gradle-8.2.1-bin.zip + distributionSha256Sum=<INSERT_SHA256_CHECKSUM_HERE>• To generate the checksum, you can download the bin ZIP and run:
sha256sum gradle-8.2.1-bin.zip | awk '{ print $1 }'• Verify the wrapper config:
rg -n '^distributionUrl=' examples/basic-examples/gradle/wrapper/gradle-wrapper.properties rg -nP '^distributionSha256Sum\s*=' examples/basic-examples/gradle/wrapper/gradle-wrapper.properties.github/dependabot.yaml (1)
15-15
: Dependabot Gradle directory checkVerified that
examples/basic-examples
contains:
build.gradle
gradlew
gradle/wrapper/gradle-wrapper.properties
However,
gradle/wrapper/gradle-wrapper.jar
is not present. Dependabot will fall back to a system Gradle or attempt to download the wrapper JAR at runtime, which can be fragile. Please commit the wrapper JAR intogradle/wrapper/gradle-wrapper.jar
(or confirm your CI environment has a compatible Gradle installation) to ensure Dependabot can reliably resolve and update dependencies.If you add more example projects in the future, remember to add each new path under the
directories
section in.github/dependabot.yaml
.examples/basic-examples/Makefile (1)
3-11
: Remove unused variable; consider minor Makefile hygiene.
project_name=.
is no longer used; remove it.- Optional: mark targets as
.PHONY
and consider--no-daemon
for CI consistency.Apply this diff to drop the unused variable:
-project_name=.
If you want the hygiene improvements (outside the changed lines), you can add:
.PHONY: all build run run-openfga
And optionally:
- ./gradlew -P language=$(language) build + ./gradlew --no-daemon -P language=$(language) build- ./gradlew -P language=$(language) run + ./gradlew --no-daemon -P language=$(language) runexamples/basic-examples/src/main/java/dev/openfga/sdk/example/Example1.java (1)
116-118
: Reflow split comment for readability.The end-of-line comment was split across lines; keep it on one line to avoid a dangling comment.
- ._object("document:0192ab2a-d83f-756d-9397-c5ed9f3cb69a") // different - // relation + ._object("document:0192ab2a-d83f-756d-9397-c5ed9f3cb69a") // different relation
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
💡 Knowledge Base configuration:
- MCP integration is disabled by default for public repositories
- Jira integration is disabled by default for public repositories
- Linear integration is disabled by default for public repositories
You can enable these sources in your CodeRabbit configuration.
⛔ Files ignored due to path filters (1)
example/example1/gradle/wrapper/gradle-wrapper.jar
is excluded by!**/*.jar
📒 Files selected for processing (5)
.github/dependabot.yaml
(1 hunks)example/README.md
(0 hunks)examples/basic-examples/Makefile
(1 hunks)examples/basic-examples/gradle/wrapper/gradle-wrapper.properties
(1 hunks)examples/basic-examples/src/main/java/dev/openfga/sdk/example/Example1.java
(2 hunks)
💤 Files with no reviewable changes (1)
- example/README.md
🔇 Additional comments (1)
examples/basic-examples/src/main/java/dev/openfga/sdk/example/Example1.java (1)
31-31
: LGTM on the formatting tweak.Inline call to
authorizationModelId(System.getenv("FGA_MODEL_ID"))
reads cleaner and doesn’t alter behavior.
Move the existing examples from the
example
directory toexamples
Description
What problem is being solved?
We currently have two example applications (one java, one kotlin) in the
example
directory. As part of #117, we should also have an open telemetry example (like other SDKs). Having multiple examples in a directory namedexample
is confusing.How is it being solved?
Move existing java and kotlin examples to a new directory,
examples/basic-examples
.What changes are made to solve it?
As little changes as possible to the actual example code has been changed. The purpose of the change is to move the existing code, not to address any issues with the current example.
That said, the build was failing due to some gradle compatibilty issues. This commit updates the gradle version and fixes spotless issues so that the example compiles and runs.
References
#117
Review Checklist
main
Summary by CodeRabbit