E52E Upgrade cody web experimental package to 0.2.7 by vovakulikov · Pull Request #63863 · sourcegraph/sourcegraph-public-snapshot · GitHub
[go: up one dir, main page]

Skip to content
This repository was archived by the owner on Sep 30, 2024. It is now read-only.

Upgrade cody web experimental package to 0.2.7#63863

Merged
vovakulikov merged 2 commits intomainfrom
vk/migrate-cody-web-to-0.2.7
Jul 16, 2024
Merged

Upgrade cody web experimental package to 0.2.7#63863
vovakulikov merged 2 commits intomainfrom
vk/migrate-cody-web-to-0.2.7

Conversation

@vovakulikov
Copy link
Contributor

S2 Cody Web is broken at the moment. New client-config handlers fail with 401 status because we don't send custom headers, this works for gql queries since they all are POST requests and the browser automatically sends an Origin header for them and this is enough for our auth middleware to check cookies, but with client-config which is rest it's not the case and we should send X-Requested-Client: Sourcegraph header to make our auth middleware to pass this query correctly

Note that this problem doesn't exist in local builds since we proxy all requests and add X-Requested-Client: Sourcegraph in dev server.

See Cody latest build PR for more details https://github.com/sourcegraph/cody/pull/4898

Test plan

  • CI is passing

@cla-bot cla-bot bot added the cla-signed label Jul 16, 2024
chatID={chatID}
initialContext={contextInfo}
serverEndpoint={window.location.origin}
customHeaders={window.context.xhrHeaders}
Copy link
Member

Choose a reason for hiding this comment

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

Ah! That's what those are for 😄

@vovakulikov vovakulikov merged commit 2908383 into main Jul 16, 2024
@vovakulikov vovakulikov deleted the vk/migrate-cody-web-to-0.2.7 branch July 16, 2024 21:43
@sourcegraph-release-bot
Copy link
Collaborator
sourcegraph-release-bot commented Jul 16, 2024

The backport to 5.5.x failed at https://github.com/sourcegraph/sourcegr 6880 aph/actions/runs/9964543345:

The process '/usr/bin/git' failed with exit code 1

To backport this PR manually, you can either:

Via the sg tool

Use the sg backport command to backport your commit to the release branch.

sg backport -r 5.5.x -p 63863
Via your terminal

To backport manually, run these commands in your terminal:

# Fetch latest updates from GitHub
git fetch
# Create a new working tree
git worktree add .worktrees/backport-5.5.x 5.5.x
# Navigate to the new working tree
cd .worktrees/backport-5.5.x
# Create a new branch
git switch --create backport-63863-to-5.5.x
# Cherry-pick the merged commit of this pull request and resolve the conflicts
git cherry-pick -x --mainline 1 290838344e95cf1c68a502c88759fd3f26b20544
# Push it to GitHub
git push --set-upstream origin backport-63863-to-5.5.x
# Go back to the original working tree
cd ../..
# Delete the working tree
git worktree remove .worktrees/backport-5.5.x

If you encouter conflict, first resolve the conflict and stage all files, then run the commands below:

git cherry-pick --continue
# Push it to GitHub
git push --set-upstream origin backport-63863-to-5.5.x
# Go back to the original working tree
cd ../..
# Delete the working tree
git worktree remove .worktrees/backport-5.5.x
  • Follow above instructions to backport the commit.
  • Create a pull request where the base branch is 5.5.x and the compare/head branch is backport-63863-to-5.5.x., click here to create the pull request.

Once the pull request has been created, please ensure the following:

  • Make sure to tag @sourcegraph/release in the pull request description.

  • kindly remove the release-blocker from this pull request.

@sourcegraph-release-bot sourcegraph-release-bot added backports failed-backport-to-5.5.x release-blocker Prevents us from releasing: https://about.sourcegraph.com/handbook/engineering/releases labels Jul 16, 2024
michaellzc pushed a commit that referenced this pull request Jul 18, 2024
S2 Cody Web is broken at the moment. New client-config handlers fail
with 401 status because we don't send custom headers, this works for gql
queries since they all are POST requests and the browser automatically
sends an Origin header for them and this is enough for our auth
middleware to check cookies, but with client-config which is rest it's
not the case and we should send `X-Requested-Client: Sourcegraph` header
to make our auth middleware to pass this query correctly

Note that this problem doesn't exist in local builds since we proxy all
requests and add `X-Requested-Client: Sourcegraph` in dev server.

See Cody latest build PR for more details
https://github.com/sourcegraph/cody/pull/4898

## Test plan
- CI is passing

(cherry picked from commit 2908383)
craigfurman pushed a commit that referenced this pull request Jul 18, 2024
…) (#63901)

backport https://github.com/sourcegraph/sourcegraph/pull/63863

S2 Cody Web is broken at the moment. New client-config handlers fail
with 401 status because we don't send custom headers, this works for gql
queries since they all are POST requests and the browser automatically
sends an Origin header for them and this is enough for our auth
middleware to check cookies, but with client-config which is rest it's
not the case and we should send `X-Requested-Client: Sourcegraph` header
to make our auth middleware to pass this query correctly

Note that this problem doesn't exist in local builds since we proxy all
requests and add `X-Requested-Client: Sourcegraph` in dev server.

See Cody latest build PR for more details
https://github.com/sourcegraph/cody/pull/4898

## Test plan

CI

Co-authored-by: Vova Kulikov <vovakulikov@icloud.com>
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

backport 5.5.x backports cla-signed failed-backport-to-5.5.x release-blocker Prevents us from releasing: https://about.sourcegraph.com/handbook/engineering/releases

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants

0