-
Notifications
You must be signed in to change notification settings - Fork 543
Add native API versioning and compatibility guards #126
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
Open
scorsin-oai
wants to merge
1
commit into
Snapchat:main
Choose a base branch
from
scorsin-oai:simon/260723-native-api-versioning
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,2 @@ | ||
| <?xml version="1.0" encoding="utf-8"?> | ||
| <manifest xmlns:android="http://schemas.android.com/apk/res/android" package="com.snap.valdi.empty" /> | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,19 @@ | ||
| """Helpers for packaging cross-platform Valdi resources.""" | ||
|
|
||
| load("@rules_android//rules:rules.bzl", "android_library") | ||
|
|
||
| def valdi_android_resource_deps(name, resources): | ||
| """Creates an Android asset dependency for cross-platform resources.""" | ||
| if not resources: | ||
| return [] | ||
|
|
||
| android_library( | ||
| name = name, | ||
| assets = resources, | ||
| # Keep these resources independent of the application's assets_dir. | ||
| # The empty root packages source resources relative to their owning | ||
| # Bazel package and generated resources relative to their output root. | ||
| assets_dir = "", | ||
| manifest = "@valdi//bzl/valdi:empty_android_manifest.xml", | ||
| ) | ||
| return [":{}".format(name)] |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,31 @@ | ||
| """Collects compilation metadata from a transitive graph of Valdi modules.""" | ||
|
|
||
| load(":common.bzl", "COMPILATION_METADATA_FILENAME") | ||
| load(":valdi_compiled.bzl", "ValdiModuleInfo") | ||
|
|
||
| def _valdi_compilation_metadata_impl(ctx): | ||
| intermediates = depset( | ||
| transitive = [ | ||
| dep[ValdiModuleInfo].intermediates | ||
| for dep in ctx.attr.deps | ||
| ], | ||
| ) | ||
| metadata = [ | ||
| file | ||
| for file in intermediates.to_list() | ||
| if file.basename == COMPILATION_METADATA_FILENAME | ||
| ] | ||
| return [DefaultInfo(files = depset(metadata))] | ||
|
|
||
| valdi_compilation_metadata = rule( | ||
| implementation = _valdi_compilation_metadata_impl, | ||
| doc = "Returns compilation-metadata.json artifacts for the transitive closure of Valdi module dependencies.", | ||
| attrs = { | ||
| "deps": attr.label_list( | ||
| mandatory = True, | ||
| cfg = "exec", | ||
| providers = [ValdiModuleInfo], | ||
| doc = "Valdi modules whose transitive compilation metadata should be collected.", | ||
| ), | ||
| }, | ||
| ) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
Semgrep identified an issue in your code:
This literal might contain a Snapchat internal reference that should not be committed to open-source repositories.
Fix: Please replace / remove the string to avoid committing it to open-source repositories.
To resolve this comment:
✨ Commit fix suggestion
.snap, for example changepackage="com.snap.valdi.empty"to something likepackage="com.example.valdi.empty".packageattribute entirely when it is not required by the file’s purpose.💬 Ignore this finding
Reply with Semgrep commands to ignore this finding.
/fp <comment>for false positive/ar <comment>for acceptable risk/other <comment>for all other reasonsAlternatively, triage in Semgrep AppSec Platform to ignore the finding created by internal-sensitive-strings.
You can view more details about this finding in the Semgrep AppSec Platform.