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

Cleanup back-compat code for interpreting Run Service status codes #3456

Merged
merged 1 commit into from
Sep 6, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
23 changes: 0 additions & 23 deletions src/Sdk/RSWebApi/RunServiceHttpClient.cs
Original file line number Diff line number Diff line change
Expand Up @@ -107,15 +107,6 @@ public async Task<AgentJobRequestMessage> GetJobMessageAsync(
}
}

// Temporary back compat
switch (result.StatusCode)
Copy link
Collaborator Author

@ericsciple ericsciple Sep 6, 2024

Choose a reason for hiding this comment

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

Tested E2E to make sure everything is still working as expected. Specifically I tested the 422 UnprocessableEntity scenario above. Easy to repro that scenario via reusable workflow with a required secret, with the caller providing an expression that evaluates to empty/nil.

Copy link
Collaborator Author

@ericsciple ericsciple Sep 6, 2024

Choose a reason for hiding this comment

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

name: CI
on:
  workflow_dispatch:
jobs:
  build:
    uses: ./.github/workflows/reuse.yml
    secrets: 
      foo: ${{ github.nosuch }}
# .github/workflows/reuse.yml

on:
  workflow_call:
    secrets:
      foo:
        description: asdf
        required: true
jobs:
  build:
    runs-on: self-hosted
    steps:
      - run: echo hi
        env:
          FOO_SECRET: ${{ secrets.foo }}

{
case HttpStatusCode.NotFound:
throw new TaskOrchestrationJobNotFoundException($"Job message not found: {messageId}");
case HttpStatusCode.Conflict:
throw new TaskOrchestrationJobAlreadyAcquiredException($"Job message already acquired: {messageId}");
}

if (!string.IsNullOrEmpty(result.ErrorBody))
{
throw new Exception($"Failed to get job message: {result.Error}. {Truncate(result.ErrorBody)}");
Expand Down Expand Up @@ -171,13 +162,6 @@ public async Task CompleteJobAsync(
}
}

// Temporary back compat
switch (result.StatusCode)
{
case HttpStatusCode.NotFound:
throw new TaskOrchestrationJobNotFoundException($"Job not found: {jobId}");
}

if (!string.IsNullOrEmpty(result.ErrorBody))
{
throw new Exception($"Failed to complete job: {result.Error}. {Truncate(result.ErrorBody)}");
Expand Down Expand Up @@ -225,13 +209,6 @@ public async Task<RenewJobResponse> RenewJobAsync(
}
}

// Temporary back compat
switch (result.StatusCode)
{
case HttpStatusCode.NotFound:
throw new TaskOrchestrationJobNotFoundException($"Job not found: {jobId}");
}

if (!string.IsNullOrEmpty(result.ErrorBody))
{
throw new Exception($"Failed to renew job: {result.Error}. {Truncate(result.ErrorBody)}");
Expand Down
Loading