-
Notifications
You must be signed in to change notification settings - Fork 285
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Populate x-fb-product-log header in Mononoke Git
Summary: `x-fb-product-log` header is a special header that is used by all of traffic infra for E2E traceability of HTTP requests. We often face traffic/network related issues in our Git, Mononoke and LFS setup so having this header would help with debugging such issues. Reviewed By: mzr, lmvasquezg Differential Revision: D64069628 fbshipit-source-id: 22fc41ed0b9931e281802a128375b414d9768c4f
- Loading branch information
1 parent
c669d66
commit 3337111
Showing
2 changed files
with
74 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
61 changes: 61 additions & 0 deletions
61
...tests/integration/mononoke_git_server/test-mononoke-git-server-push-with-fb-product-log.t
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,61 @@ | ||
# Copyright (c) Meta Platforms, Inc. and affiliates. | ||
# | ||
# This software may be used and distributed according to the terms of the | ||
# GNU General Public License found in the LICENSE file in the root | ||
# directory of this source tree. | ||
|
||
$ . "${TEST_FIXTURES}/library.sh" | ||
$ REPOTYPE="blob_files" | ||
$ setup_common_config $REPOTYPE | ||
$ GIT_REPO_ORIGIN="${TESTTMP}/origin/repo-git" | ||
$ GIT_REPO="${TESTTMP}/repo-git" | ||
$ SCUBA="$TESTTMP/scuba.json" | ||
|
||
# Setup git repository | ||
$ mkdir -p "$GIT_REPO_ORIGIN" | ||
$ cd "$GIT_REPO_ORIGIN" | ||
$ git init -q | ||
$ echo "this is file1" > file1 | ||
$ git add file1 | ||
$ git commit -qam "Add file1" | ||
$ git tag -a -m "new tag" first_tag | ||
$ echo "this is file2" > file2 | ||
$ git add file2 | ||
$ git commit -qam "Add file2" | ||
$ master_commit=$(git rev-parse HEAD) | ||
|
||
$ cd "$TESTTMP" | ||
$ git clone --mirror "$GIT_REPO_ORIGIN" repo-git | ||
Cloning into bare repository 'repo-git'... | ||
done. | ||
|
||
# Import it into Mononoke | ||
$ cd "$TESTTMP" | ||
$ quiet gitimport "$GIT_REPO" --derive-hg --generate-bookmarks full-repo | ||
|
||
# Set Mononoke as the Source of Truth | ||
$ set_mononoke_as_source_of_truth_for_git | ||
|
||
# Start up the Mononoke Git Service | ||
$ mononoke_git_service | ||
# Clone the Git repo from Mononoke | ||
$ git_client clone $MONONOKE_GIT_SERVICE_BASE_URL/$REPONAME.git | ||
Cloning into 'repo'... | ||
$ cd repo | ||
|
||
# Add some new commits to the master branch | ||
$ echo "Just another file" > another_file | ||
$ git add . | ||
$ git commit -qam "Another commit on master" | ||
|
||
# Push all the changes made so far | ||
$ git_client push origin master | ||
To https://localhost:$LOCAL_PORT/repos/git/ro/repo.git | ||
e8615d6..4981a25 master -> master | ||
|
||
# Wait for the warm bookmark cache to catch up with the latest changes | ||
$ wait_for_git_bookmark_move HEAD $master_commit | ||
|
||
# Verify the push validation errors got recorded in scuba | ||
$ jq -S .normal "$SCUBA" | grep product | wc -l | ||
25 |