Skip to content

Conversation

@Konboi
Copy link
Contributor

@Konboi Konboi commented May 2, 2025

According to the documentation, it's supposed to be supported, but the subset isn't actually supported

image
ref: https://www.launchableinc.com/docs/resources/cli-reference/#3500790-subset

$ launchable subset --session-name test-session
Usage: launchable subset [OPTIONS] COMMAND [ARGS]...
Try 'launchable subset --help' for help.

Error: No such option: --session-name Did you mean --session?

Even in the record tests command with the session-name option, the build option is required.
So for case the session-name option is set and the build option isn't set, the CLI treated it as a miss integration, and made it exit with status code 1 to prevent the process from continuing.

Checked Locally

$ launchable record build --name session-name-test
Launchable transferred 1 more commit from repository /Users/yabuki-ryosuke/src/github.com/launchableinc/cli
Launchable recorded build session-name-test to workspace launchableinc/mothership with commits from 1 repository:

| Name   | Path   | HEAD Commit                              |
|--------|--------|------------------------------------------|
| .      | .      | 1fdf4db7a34e5317c039212a292d90145a571d24 |

Visit https://app.launchableinc.com/organizations/launchable

$ launchable record session --build session-name-test --session-name this-is-a-session-name
builds/session-name-test/test_sessions/2909

$ find ./tests/**/test_*.py | launchable subset --target 60% --build session-name-test --session-name this-is-a-session-name file > subset.txt
Your model is currently in training
Launchable created subset 68 for build session-name-test (test session 2909) in workspace launchableinc/mothership

|           |   Candidates |   Estimated duration (%) |   Estimated duration (min) |
|-----------|--------------|--------------------------|----------------------------|
| Subset    |           24 |                    47.06 |                       0.00 |
| Remainder |           27 |                    52.94 |                       0.00 |
|           |              |                          |                            |
| Total     |           51 |                   100.00 |                       0.00 |

Run `launchable inspect subset --subset-id 68` to view full subset details

Summary by CodeRabbit

  • New Features
    • Added an optional --session-name option to the subset command to specify a test session by name.
  • Bug Fixes
    • Enhanced error handling for the --session-name option with clearer user feedback on incorrect usage.

According to the documentation, it's supposed to be supported, but the subset isn't actually supported
@coderabbitai
Copy link
Contributor

coderabbitai bot commented May 2, 2025

Walkthrough

A new optional --session-name parameter has been introduced to the subset command, allowing users to specify a test session by name instead of by ID. If --session-name is used, the --build option must also be provided; otherwise, a usage error is raised. The command now queries the Launchable API to resolve the session name to an ID and constructs the session identifier accordingly. Additional error handling for incorrect usage of --session-name has been implemented.

Changes

File(s) Change Summary
launchable/commands/subset.py Added --session-name CLI option and logic to resolve session name to ID via API; updated error handling; added session_name parameter to subset function.

Sequence Diagram(s)

sequenceDiagram
    participant User
    participant CLI
    participant LaunchableAPI

    User->>CLI: launch subset --session-name NAME --build BUILD
    CLI->>CLI: Validate both --session-name and --build are provided
    CLI->>LaunchableAPI: GET /builds/{build_name}/test_session_names/{session_name}
    LaunchableAPI-->>CLI: Responds with session ID
    CLI->>CLI: Construct session identifier using session ID
    CLI->>CLI: Proceed with subset logic
Loading

Poem

In the warren of code, a new path appears,
--session-name now guides us, allaying our fears.
With a hop to the API, the session ID's found,
If --build is missing, a red warning sounds!
Rabbits rejoice for this feature so keen—
More ways to test, in Launchable's scene! 🐇

Tip

⚡️ Faster reviews with caching
  • CodeRabbit now supports caching for code and dependencies, helping speed up reviews. This means quicker feedback, reduced wait times, and a smoother review experience overall. Cached data is encrypted and stored securely. This feature will be automatically enabled for all accounts on May 16th. To opt out, configure Review - Disable Cache at either the organization or repository level. If you prefer to disable all data retention across your organization, simply turn off the Data Retention setting under your Organization Settings.

Enjoy the performance boost—your workflow just got faster.


📜 Recent review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 266649a and d64326a.

📒 Files selected for processing (1)
  • launchable/commands/subset.py (3 hunks)
🚧 Files skipped from review as they are similar to previous changes (1)
  • launchable/commands/subset.py
⏰ Context from checks skipped due to timeout of 90000ms (13)
  • GitHub Check: build (windows-latest, 3.6)
  • GitHub Check: build (windows-latest, 3.12)
  • GitHub Check: build (windows-latest, 3.11)
  • GitHub Check: build (windows-latest, 3.10)
  • GitHub Check: build (windows-latest, 3.9)
  • GitHub Check: build (windows-latest, 3.8)
  • GitHub Check: build (windows-latest, 3.7)
  • GitHub Check: build (ubuntu-22.04, 3.12)
  • GitHub Check: build (ubuntu-22.04, 3.11)
  • GitHub Check: build (ubuntu-22.04, 3.10)
  • GitHub Check: build (ubuntu-22.04, 3.9)
  • GitHub Check: build (ubuntu-22.04, 3.8)
  • GitHub Check: build (ubuntu-22.04, 3.7)
✨ Finishing Touches
  • 📝 Generate Docstrings

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
🪧 Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>, please review it.
    • Generate unit testing code for this file.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query. Examples:
    • @coderabbitai generate unit testing code for this file.
    • @coderabbitai modularize this function.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @coderabbitai read src/utils.ts and generate unit testing code.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.
    • @coderabbitai help me debug CodeRabbit configuration file.

Support

Need help? Create a ticket on our support page for assistance with any issues or questions.

Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments.

CodeRabbit Commands (Invoked using PR comments)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai full review to do a full review from scratch and review all the files again.
  • @coderabbitai summary to regenerate the summary of the PR.
  • @coderabbitai generate docstrings to generate docstrings for this PR.
  • @coderabbitai generate sequence diagram to generate a sequence diagram of the changes in this PR.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

Other keywords and placeholders

  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai anywhere in the PR title to generate the title automatically.

CodeRabbit Configuration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • Please see the configuration documentation for more information.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json

Documentation and Community

  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

Copy link
Contributor

@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

🧹 Nitpick comments (1)
launchable/commands/subset.py (1)

275-284: Fix grammatical error in the error message.

The error message contains a small grammatical error.

-                    '--build option is required when you uses a --session-name option ')
+                    '--build option is required when you use a --session-name option')
📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between fc3cf34 and 1fdf4db.

📒 Files selected for processing (1)
  • launchable/commands/subset.py (3 hunks)
⏰ Context from checks skipped due to timeout of 90000ms (11)
  • GitHub Check: build (windows-latest, 3.6)
  • GitHub Check: build (windows-latest, 3.12)
  • GitHub Check: build (windows-latest, 3.11)
  • GitHub Check: build (windows-latest, 3.10)
  • GitHub Check: build (windows-latest, 3.9)
  • GitHub Check: build (windows-latest, 3.8)
  • GitHub Check: build (windows-latest, 3.7)
  • GitHub Check: build (ubuntu-22.04, 3.10)
  • GitHub Check: build (ubuntu-22.04, 3.9)
  • GitHub Check: build (ubuntu-22.04, 3.8)
  • GitHub Check: build (ubuntu-22.04, 3.7)
🔇 Additional comments (4)
launchable/commands/subset.py (4)

162-169: Correctly adds support for the --session-name option.

This change properly implements the --session-name option to align with documented behavior, addressing the issue described in the PR objectives.


221-221: Properly integrates the session_name parameter.

The function signature is correctly updated with the optional parameter that has appropriate type annotation and default value.


275-296: Logic for session name resolution looks good.

The implementation correctly:

  1. Requires --build when --session-name is specified
  2. Makes an API request to resolve the session name to an ID
  3. Constructs the session identifier properly
  4. Falls back to existing session handling logic when --session-name is not provided

The error handling is also appropriate for handling configuration issues.


297-304: Error handling is properly implemented.

This error handling ensures that when --session-name is used incorrectly (without the required --build option), the CLI displays a clear error message and exits with status code 1, preventing further processing as specified in the PR objectives.

@Konboi Konboi requested a review from ono-max May 8, 2025 07:18
test_suite=test_suite,
)
except click.UsageError as e:
click.echo(
Copy link
Contributor

Choose a reason for hiding this comment

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

Also, I'd like to capture this exception in the telemetry.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@sonarqubecloud
Copy link

sonarqubecloud bot commented May 8, 2025

@Konboi Konboi requested a review from ono-max May 8, 2025 10:23
@Konboi Konboi merged commit 21f9cfe into main May 9, 2025
16 checks passed
@Konboi Konboi deleted the support-session-name-to-subset branch May 9, 2025 00:13
@github-actions github-actions bot mentioned this pull request May 9, 2025
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.

3 participants