Skip to content

Conversation

@Yash02Rajput
Copy link
Contributor

@Yash02Rajput Yash02Rajput commented Feb 2, 2026

Summary by CodeRabbit

  • New Features

    • Release experiments now include explicit variant identifiers for control and experimental versions, improving experiment tracking and management.
  • Improvements

    • Updated experiment conclusion and revert workflows to use stored variant identifiers instead of dynamically constructed references, enhancing reliability.

@semanticdiff-com
Copy link

semanticdiff-com bot commented Feb 2, 2026

Review changes with  SemanticDiff

Changed Files
File Status
  airborne_dashboard/app/dashboard/[orgId]/[appId]/releases/[releaseId]/page.tsx  4% smaller
  airborne_server/src/release.rs  1% smaller
  airborne_server/src/release/types.rs  0% smaller
  airborne_server/src/release/utils.rs  0% smaller

@coderabbitai
Copy link

coderabbitai bot commented Feb 2, 2026

Walkthrough

This change introduces a new experiment_variants field to the ReleaseExperiment structure across frontend and backend layers. The field encapsulates control and experimental variant IDs extracted from experiment details, replacing previous string-concatenation logic with direct references to computed variant identifiers.

Changes

Cohort / File(s) Summary
Type Definitions
airborne_server/src/release/types.rs
Introduced new ExperimentVariants struct with control: String and experimentals: Vec<String> fields, and added experiment_variants field to ReleaseExperiment.
Utility Functions
airborne_server/src/release/utils.rs
Added extract_variants_from_experiment() helper function that extracts control and experimental variant IDs from a slice of Variant objects; integrated it into build_release_experiment_from_experiment() to populate the new field.
Backend Release Logic
airborne_server/src/release.rs
Populated experiment_variants field in ReleaseExperiment across get_release(), create_release(), and update_release() endpoints by extracting variant information from experiment details.
Frontend Release Page
airborne_dashboard/app/dashboard/[orgId]/[appId]/releases/[releaseId]/page.tsx
Updated ReleaseExperiment interface to include new experiment_variants field; replaced hardcoded string-concatenation logic in API calls with direct references to the computed variant identifiers.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~25 minutes

Poem

🐰 Variants once tangled in strings we'd weave,
Now structured neat—control and experimental leaves,
From experiment details, we gently extract,
Each layer aligned, each field compact,
Our dashboard now knows precisely which hops,
To choose for each release when the testing stops!

🚥 Pre-merge checks | ✅ 2 | ❌ 1
❌ Failed checks (1 warning)
Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 37.50% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (2 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly describes the main change: replacing hardcoded string concatenation with actual experiment variant IDs for release conclude and revert operations.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing touches
  • 📝 Generate docstrings
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch fix-conclude-experiment

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

Copy link

@coderabbitai coderabbitai bot left a 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

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (2)
airborne_dashboard/app/dashboard/[orgId]/[appId]/releases/[releaseId]/page.tsx (1)

217-235: ⚠️ Potential issue | 🟡 Minor

Potential runtime error when accessing experimentals[0] on empty array.

If experiment_variants.experimentals is empty, accessing index [0] will return undefined, which will be sent as the chosen_variant in the API request. This could cause the backend to fail with an unhelpful error or behave unexpectedly.

Consider adding a guard or using optional chaining with a fallback:

🛡️ Suggested defensive check
 const handleConcludeRelease = async () => {
   setIsConcluding(true);
   try {
+    const experimentalVariant = release.experiment.experiment_variants.experimentals[0];
+    if (!experimentalVariant) {
+      console.error("No experimental variant available to conclude");
+      return;
+    }
     await apiFetch(
       `/releases/${encodeURIComponent(releaseId)}/conclude`,
       {
         method: "POST",
-        body: { chosen_variant: release.experiment.experiment_variants.experimentals[0] },
+        body: { chosen_variant: experimentalVariant },
       },
       { token, org, app }
     );
airborne_server/src/release.rs (1)

1629-1639: ⚠️ Potential issue | 🔴 Critical

Use updated_experiment_response to construct the response instead of pre-update experiment_details.

The experiment_details is fetched before the Superposition API update (line 1466), so experiment_details.variants returns stale variant IDs. After the update call at line 1526, updated_experiment_response contains the updated experiment state with current variant IDs. The create_release handler correctly uses build_release_experiment_from_experiment() with the API response object (line 865–866), but update_release constructs the response manually with pre-update data. Additionally, status and traffic_percentage are hard-coded instead of sourced from updated_experiment_response, which will also return incorrect values.

Replace the manual ReleaseExperiment construction with:

experiment: Some(utils::build_release_experiment_from_experiment(
    &updated_experiment_response,
    pkg_version,
)),

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.

1 participant