Skip to content
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

fix: stop jobs with short ids #4657

Merged
merged 2 commits into from
Oct 24, 2024

Conversation

wdbaruni
Copy link
Member

This PR enables stopping jobs using short IDs, such as j-d43c044b instead of j-d43c044b-f731-4256-a3d6-e62fac426d15. It also improves the error reported when passing wrong jobID or if multiple jobs match the pefix

Testing Done

  • Introduced new StopSuite test suite
  • Manual testing as shown below
# short job id
→ bacalhau job stop j-3dc57b6a
Checking job status

	Connecting to network  ................  done ✅  0.0s
	  Verifying job state  ................  done ✅  0.0s
	         Stopping job  ................  done ✅  0.0s

Job stop successfully submitted with evaluation ID: 65035d30-b093-4458-bd8e-ac5b5aad27a4


# multiple jobs matching the prefix
→ bacalhau job stop j-
Checking job status

	Connecting to network  ................  done ✅  0.0s
	  Verifying job state  ................  err  ❌  0.0s

Error: multiple jobs found for id j-
Hint:  Use full job ID


# no matching job id
→ bacalhau job stop j-123
Checking job status

	Connecting to network  ................  done ✅  0.0s
	  Verifying job state  ................  err  ❌  0.0s

Error: job not found: j-123

Fixes #4643
Fixes #3674
Fixes #4644

Copy link

linear bot commented Oct 24, 2024

@wdbaruni wdbaruni self-assigned this Oct 24, 2024
@wdbaruni wdbaruni closed this Oct 24, 2024
@wdbaruni wdbaruni reopened this Oct 24, 2024
@wdbaruni wdbaruni merged commit fb0232a into main Oct 24, 2024
12 of 13 checks passed
@wdbaruni wdbaruni deleted the eng-290-cannot-stop-a-job-using-its-short-id branch October 24, 2024 11:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
1 participant