Skip to content

Add native API versioning and compatibility guards#126

Open
scorsin-oai wants to merge 1 commit into
Snapchat:mainfrom
scorsin-oai:simon/260723-native-api-versioning
Open

Add native API versioning and compatibility guards#126
scorsin-oai wants to merge 1 commit into
Snapchat:mainfrom
scorsin-oai:simon/260723-native-api-versioning

Conversation

@scorsin-oai

Copy link
Copy Markdown
Collaborator

Description

This change adds support for runtime versioning. It is designed to allow TS code to safely drift apart from its underlying native runtime.

The key concepts are as follow:

  • Types, functions, properties etc... can be annotated with @Version() and an arbitrary int version
  • User can check for runtime version using isVersionAtLeast().
  • The runtime bundles a version number.
  • The TS compiler checks for these versions and make compilation fail when using a versioned type that is not properly guarded using isVersionAtLeast()

Type of Change

  • Bug fix (non-breaking change that fixes an issue)
  • Documentation improvement
  • Performance optimization
  • Test improvement
  • Other (please describe)

Testing

  • Tests pass locally (bazel test //...)
  • Added/updated tests for changes (if applicable)
  • Tested on multiple platforms (iOS/Android/Web/macOS as applicable)
  • Manual testing performed (describe below)

Testing Details

Checklist

  • Code follows project style guidelines
  • Documentation updated (if needed)
  • No breaking changes (or documented in description)
  • Commit messages follow conventional format
  • No secrets, API keys, or internal URLs included

Related Issues

Additional Context

@@ -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" />

Copy link
Copy Markdown

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
  1. Replace the internal package name in the manifest with a neutral open-source identifier that does not include .snap, for example change package="com.snap.valdi.empty" to something like package="com.example.valdi.empty".
  2. Keep the new package value consistent with the module’s intended public namespace so Android tooling still treats it as the app/package identifier.
  3. Alternatively, if this manifest is only a placeholder or test fixture, remove the package attribute 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 reasons

Alternatively, 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.

@github-actions github-actions Bot added area/runtime Valdi runtime (C++/native) area/compiler Valdi compiler area/build-system Bazel build rules and config labels Jul 23, 2026
@github-actions

Copy link
Copy Markdown

Sensitive Files Detected

🔧 Build rules — Affects build rules for all Valdi consumers.

This is an automated notice. A maintainer will review after import.

@github-actions

Copy link
Copy Markdown

🎉 Bazel & CI Test Results

Test Suite Result
API Surface Check ✅ success
Valdi Smoke Tests ✅ success
Snapshot Tests ✅ success
Linux: Build Compiler ✅ success
Linux: C++ Tests ✅ success
Linux: Build & Export ✅ success
macOS: C++ & Platform Tests ✅ success

All Bazel configuration and CI tests passed!

The build system and core tooling are working correctly.

🚀 Bazel remote cache is now enabled - future builds will be faster!

Workflow: Valdi CI

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area/build-system Bazel build rules and config area/compiler Valdi compiler area/runtime Valdi runtime (C++/native)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant