Skip to content

Conversation

@gayanW
Copy link
Contributor

@gayanW gayanW commented Jul 31, 2025

Before:
Previously --session flag was not validated when the observation mode is on.

% launchable subset --help
Usage: launchable subset [OPTIONS] COMMAND [ARGS]...
  Subsetting tests
Options:
  .....
  --session TEXT                  Test session ID
% launchable subset --target 25% --session 4785415 --observation gradle src/test/java              
An error occurred on Launchable CLI. You can ignore this message since the process will continue. 
Error: HTTPSConnectionPool(host='api.mercury.launchableinc.com', port=443): Max retries exceeded with url: /intake/organizations/defaulttm/workspaces/my-initial-tests/4785415 (Caused by ResponseError('too many 500 error responses'))
--tests example.MulTest --tests example.Add2Test --tests example.DB1Test --tests example.DB0Test --tests example.AddTest --tests example.SubTest --tests example.DivTest --tests example.File1Test --tests example.File0Test

The above command would send requests to intake server with invalid session string.

After:

% launchable subset --help
Usage: launchable subset [OPTIONS] COMMAND [ARGS]...
  Subsetting tests
Options:
  .....
  --session TEXT                  In the format builds/<build-
                                  name>/test_sessions/<test-session-id>
% launchable subset --target 25% --session 4785415 --observation gradle src/test/java                           
An error occurred on Launchable CLI. You can ignore this message since the process will continue. 
Error: Wrong session format; session format is like 'builds/<build name>/test_sessions/<test session id>'.: 4785415
--tests example.MulTest --tests example.Add2Test --tests example.DB1Test --tests example.DB0Test --tests example.AddTest --tests example.SubTest --tests example.DivTest --tests example.File1Test --tests example.File0Test

The session flag value is now validated in the CLI side.

And the command now outputs more appropriate error indicating that the session format is invalid.

The --session flag is not validated when the observation mode is on, resulting in an internal error. This commit fixes it.
@gayanW gayanW requested review from Konboi and ono-max July 31, 2025 00:37
Copy link
Contributor

@ono-max ono-max left a comment

Choose a reason for hiding this comment

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

@gayanW

You can do that in another PR, but could you update the CLI option description in launchable record tests and launchable record attachment as well?

@sonarqubecloud
Copy link

sonarqubecloud bot commented Aug 1, 2025

@gayanW gayanW merged commit 4bcb9e2 into main Aug 4, 2025
15 checks passed
@gayanW gayanW deleted the AIENG-204 branch August 4, 2025 00:17
@github-actions github-actions bot mentioned this pull request Aug 4, 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.

4 participants