Skip to content
Closed
Show file tree
Hide file tree
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

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

106 changes: 106 additions & 0 deletions apps/api/src/handlers/tasks/__tests__/manageSourceControl.test.ts

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

19 changes: 14 additions & 5 deletions apps/api/src/handlers/tasks/manageSourceControl.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,12 @@ import {
completeClaimedLatestUserMessageForReplyQuote,
restoreClaimedLatestUserMessageForReplyQuote,
} from '@roomote/communication/messages';
import { resolveSourceControlProviderFromPayload } from '@roomote/types';

import {
createOrUpdateSourceControlPullRequestForTaskRun,
findTaskRunForSourceControlMutation,
manageSourceControlIssueForTaskRun,
readSourceControlPullRequestForTaskRun,
resolveSourceControlProviderForRepositoryFromPayload,
sourceControlIssueInputSchema,
sourceControlPullRequestMutationInputSchema,
sourceControlPullRequestReadInputSchema,
Expand Down Expand Up @@ -93,11 +92,21 @@ export async function manageSourceControl(
runId: auth.authContext.runId,
taskId,
});
const isGitHubTask =
resolveSourceControlProviderFromPayload(taskRun.payload) === 'github';
const payload =
taskRun.payload &&
typeof taskRun.payload === 'object' &&
!Array.isArray(taskRun.payload)
? (taskRun.payload as Record<string, unknown>)
: {};
const targetProvider =
input.sourceControlProvider ??
resolveSourceControlProviderForRepositoryFromPayload(
payload,
input.repositoryFullName,
);
const bodyInput = 'body' in input ? input : null;
const shouldQuote =
isGitHubTask &&
targetProvider === 'github' &&
(input.action === 'reply_to_pull_request_comment' ||
input.action === 'create_pull_request_comment' ||
input.action === 'create_issue_comment') &&
Expand Down
3 changes: 3 additions & 0 deletions apps/docs/environments.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,9 @@ environment and add any setup guidance you already know. Roomote then starts
an environment setup task that figures out how to run the app locally and
prepare the workspace for future tasks.

An environment can combine repositories from different source-control
providers, such as GitHub and GitLab.

The setup task is meant to produce a working environment Roomote can reuse. If
it cannot finish, adjust the input and try again from
**Settings > Environments**.
Expand Down
18 changes: 18 additions & 0 deletions apps/web/src/trpc/commands/environments/index.test.ts

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion apps/web/src/trpc/commands/environments/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1249,7 +1249,7 @@ export async function validateConfigCommand(

if (!hasAccess) {
errors.push(
`Repository '${repo.repository}' is not accessible. Ensure it is installed via the GitHub App.`,
`Repository '${repo.repository}' is not accessible. Ensure it is connected through its source-control provider.`,
);
return; // skip branch check if repo itself is inaccessible
}
Expand Down
19 changes: 19 additions & 0 deletions apps/worker/src/commands/__tests__/snapshot.test.ts

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading
Loading