Skip to content

Commit

Permalink
Merge branch 'main' into add-support-for-previous
Browse files Browse the repository at this point in the history
  • Loading branch information
libmartinito committed Jul 3, 2024
2 parents 6ae81b9 + d9d7c00 commit 1f312ce
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
set -eu

# allow overriding the version
VERSION=${CODECRAFTERS_CLI_VERSION:-v30}
VERSION=${CODECRAFTERS_CLI_VERSION:-v31}

PLATFORM=$(uname -s)
ARCH=$(uname -m)
Expand Down
2 changes: 1 addition & 1 deletion internal/commands/submit.go
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ func SubmitCommand(ctx context.Context) (err error) {

logger.Debug().Msgf("creating submission for %s", commitSha)

createSubmissionResponse, err := codecraftersClient.CreateSubmission(codecraftersRemote.CodecraftersRepositoryId(), commitSha, "current_and_previous_descending")
createSubmissionResponse, err := codecraftersClient.CreateSubmission(codecraftersRemote.CodecraftersRepositoryId(), commitSha, "submit", "current_and_previous_descending")
if err != nil {
return fmt.Errorf("create submission: %w", err)
}
Expand Down
2 changes: 1 addition & 1 deletion internal/commands/test.go
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,7 @@ func TestCommand(ctx context.Context, shouldTestPrevious bool) (err error) {
stageSelectionStrategy = "current_and_previous_ascending"
}

createSubmissionResponse, err := codecraftersClient.CreateSubmission(codecraftersRemote.CodecraftersRepositoryId(), tempCommitSha, stageSelectionStrategy)
createSubmissionResponse, err := codecraftersClient.CreateSubmission(codecraftersRemote.CodecraftersRepositoryId(), tempCommitSha, "test", stageSelectionStrategy)
if err != nil {
return fmt.Errorf("create submission: %w", err)
}
Expand Down
4 changes: 2 additions & 2 deletions internal/utils/codecrafters_client.go
Original file line number Diff line number Diff line change
Expand Up @@ -88,12 +88,12 @@ func (c CodecraftersClient) headers() map[string]string {
}
}

func (c CodecraftersClient) CreateSubmission(repositoryId string, commitSha string, stageSelectionStrategy string) (CreateSubmissionResponse, error) {
func (c CodecraftersClient) CreateSubmission(repositoryId string, commitSha string, command string, stageSelectionStrategy string) (CreateSubmissionResponse, error) {
response, err := grequests.Post(c.ServerUrl+"/services/cli/create_submission", &grequests.RequestOptions{
JSON: map[string]interface{}{
"repository_id": repositoryId,
"commit_sha": commitSha,
"should_auto_advance": false,
"command": command,
"stage_selection_strategy": stageSelectionStrategy,
},
Headers: c.headers(),
Expand Down

0 comments on commit 1f312ce

Please sign in to comment.