Skip to content

Commit

Permalink
Improve branch naming
Browse files Browse the repository at this point in the history
Summary: Rename mainline branch from master -> main.

Test Plan: Jenkins

Reviewers: michelle, #engineering

Reviewed By: michelle, #engineering

Differential Revision: https://phab.corp.pixielabs.ai/D5457

GitOrigin-RevId: 6fa17bb
  • Loading branch information
zasgar committed Jul 2, 2020
1 parent 8f4e365 commit 3554b49
Show file tree
Hide file tree
Showing 6 changed files with 34 additions and 34 deletions.
6 changes: 3 additions & 3 deletions .arcconfig
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
{
"phabricator.uri" : "https://phab.corp.pixielabs.ai/",
"repository.callsign": "PLM",
"arc.land.onto.default": "master",
"base": "git:merge-base(origin/master), arc:prompt",
"arc.feature.start.default": "origin/master",
"arc.land.onto.default": "main",
"base": "git:merge-base(origin/main), arc:prompt",
"arc.feature.start.default": "origin/main",
"load": ["./linters/arc-tslint", "./linters/arcanist-go",
"./linters/clang-format-linter", "./linters/shellcheck-linter", "./linters/pinterest", "./linters"],
"unit.engine": "PLTestEngine"
Expand Down
50 changes: 25 additions & 25 deletions Jenkinsfile
Original file line number Diff line number Diff line change
Expand Up @@ -111,16 +111,16 @@ devDockerImageExtrasWithTag = ''
stashList = [];

// Flag controlling if coverage job is enabled.
isMasterCodeReviewRun = (env.JOB_NAME == "pixielabs-master-phab-test")
isMasterRun = (env.JOB_NAME == "pixielabs-master")
isNightlyTestRegressionRun = (env.JOB_NAME == "pixielabs-master-nightly-test-regression")
isCLIBuildRun = env.JOB_NAME.startsWith("pixielabs-master-cli-release-build/")
isVizierBuildRun = env.JOB_NAME.startsWith("pixielabs-master-vizier-release-build/")
isCloudStagingBuildRun = env.JOB_NAME.startsWith("pixielabs-master-cloud-staging-build/")
isCloudProdBuildRun = env.JOB_NAME.startsWith("pixielabs-master-cloud-release-build/")
isMainCodeReviewRun = (env.JOB_NAME == "pixielabs-main-phab-test")
isMainRun = (env.JOB_NAME == "pixielabs-main")
isNightlyTestRegressionRun = (env.JOB_NAME == "pixielabs-main-nightly-test-regression")
isCLIBuildRun = env.JOB_NAME.startsWith("pixielabs-main-cli-release-build/")
isVizierBuildRun = env.JOB_NAME.startsWith("pixielabs-main-vizier-release-build/")
isCloudStagingBuildRun = env.JOB_NAME.startsWith("pixielabs-main-cloud-staging-build/")
isCloudProdBuildRun = env.JOB_NAME.startsWith("pixielabs-main-cloud-release-build/")

// TODO(zasgar): Fix the coverage job which is broken due to GCC upgrade.
runCoverageJob = false; // isMasterRun
runCoverageJob = false; // isMainRun

// Currently disabling TSAN on BPF builds because it runs too slow.
// In particular, the uprobe deployment takes far too long. See issue:
Expand Down Expand Up @@ -178,7 +178,7 @@ def addBuildInfo = {

def text = ""
def link = ""
// Either a revision of a commit to master.
// Either a revision of a commit to main.
if (params.REVISION) {
def revisionId = "D${REVISION}"
text = revisionId
Expand All @@ -197,7 +197,7 @@ def addBuildInfo = {

/**
* @brief Returns true if it's a phabricator triggered build.
* This could either be code review build or master commit.
* This could either be code review build or main commit.
*/
def isPhabricatorTriggeredBuild() {
return params.PHID != null && params.PHID != ""
Expand Down Expand Up @@ -225,7 +225,7 @@ def writeBazelRCFile() {
}

def createBazelStash(String stashName) {
if (!isMasterCodeReviewRun || shFileExists("bazel-testlogs-archive")) {
if (!isMainCodeReviewRun || shFileExists("bazel-testlogs-archive")) {
sh 'rm -rf bazel-testlogs-archive'
sh 'cp -a bazel-testlogs/ bazel-testlogs-archive'
stashOnGCS(stashName, 'bazel-testlogs-archive/**')
Expand Down Expand Up @@ -327,14 +327,14 @@ def bazelCCCICmd(String name, String targetConfig='clang', String targetCompilat
}

/**
* Runs bazel CI mode for master/phab builds.
* Runs bazel CI mode for main/phab builds.
*
* The targetFilter can either be a bazel filter clause, or bazel path (//..., etc.), but not a list of paths.
*/
def bazelCICmd(String name, String targetConfig='clang', String targetCompilationMode='opt',
String targetFilter=BAZEL_SRC_FILES_PATH) {
warnError('Bazel command failed') {
if (isMasterCodeReviewRun) {
if (isMainCodeReviewRun) {
def targetPattern = targetFilter
sh """
TARGET_PATTERN='${targetPattern}' CONFIG=${targetConfig} \
Expand Down Expand Up @@ -434,9 +434,9 @@ def postBuildActions = {
codeReviewPostBuild()
}

// Master runs are triggered by Phabricator, but we still want
// Main runs are triggered by Phabricator, but we still want
// notifications on failure.
if (!isPhabricatorTriggeredBuild() || isMasterRun) {
if (!isPhabricatorTriggeredBuild() || isMainRun) {
sendSlackNotification()
}
}
Expand Down Expand Up @@ -480,13 +480,13 @@ builders['Clang-tidy'] = {
WithSourceCode {
dockerStep {
def stashName = 'build-clang-tidy-logs'
if (isMasterRun) {
// For master builds we run clang tidy on changes files in the past 10 revisions,
if (isMainRun) {
// For main builds we run clang tidy on changes files in the past 10 revisions,
// this gives us a good balance of speed and coverage.
sh 'scripts/run_clang_tidy.sh -f diff_head_cc'
} else {
// For code review builds only run on diff.
sh 'scripts/run_clang_tidy.sh -f diff_origin_master_cc'
sh 'scripts/run_clang_tidy.sh -f diff_origin_main_cc'
}
stashOnGCS(stashName, 'clang_tidy.log')
stashList.add(stashName)
Expand All @@ -512,7 +512,7 @@ builders['Build & Test All (opt + UI)'] = {
}

// File might not always exist because of test run caching.
// TODO(zasgar): Make sure this file is fetched for master run, otherwise we
// TODO(zasgar): Make sure this file is fetched for main run, otherwise we
// might have issues with coverage.
def uiTestResults = 'bazel-testlogs-archive/src/ui/ui-tests/test.outputs/outputs.zip'
if (shFileExists(uiTestResults)) {
Expand Down Expand Up @@ -569,12 +569,12 @@ if (runBPFWithTSAN) {
}
}

// Only run coverage on master test.
// Only run coverage on main test.
if (runCoverageJob) {
builders['Build & Test (gcc:coverage)'] = {
WithSourceCode {
dockerStep {
sh "scripts/collect_coverage.sh -u -t ${CODECOV_TOKEN} -b master -c `cat GIT_COMMIT`"
sh "scripts/collect_coverage.sh -u -t ${CODECOV_TOKEN} -b main -c `cat GIT_COMMIT`"
createBazelStash('build-gcc-coverage-testlogs')
}
}
Expand Down Expand Up @@ -612,13 +612,13 @@ builders['Lint & Docs'] = {
* The build script starts here.
********************************************/
def buildScriptForCommits = {
if (isMasterRun) {
if (isMainRun) {
// If there is a later build queued up, we want to stop the current build so
// we can execute the later build instead.
def q = Jenkins.instance.queue
abortBuild = false
q.items.each {
if (it.task.name == "pixielabs-master") {
if (it.task.name == "pixielabs-main") {
abortBuild = true
}
}
Expand All @@ -644,8 +644,8 @@ def buildScriptForCommits = {
parallel(builders)
}

// Only run the cloud deploy build on master run.
if (isMasterRun) {
// Only run the cloud deploy build on main run.
if (isMainRun) {
stage('Create cloud artifacts') {
deleteDir()
WithSourceCode {
Expand Down
2 changes: 1 addition & 1 deletion ci/bazel_ci.sh
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@
# environment variable.
set -x

COMMIT_RANGE=${COMMIT_RANGE:-$(git merge-base origin/master HEAD)".."}
COMMIT_RANGE=${COMMIT_RANGE:-$(git merge-base origin/main HEAD)".."}
TARGET_PATTERN=${TARGET_PATTERN:-"//..."}
BAZEL_RUN_EXTRA_ARGS=
BAZEL_QUERY_EXTRA_ARGS=
Expand Down
4 changes: 2 additions & 2 deletions ci/save_version_info.sh
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,8 @@ else
echo "0.0.${BUILD_NUMBER}-${JOB_NAME}-dev" > VERSION
fi

git diff -U0 origin/master > diff_origin_master
git diff -U0 origin/master -- '***.cc' '***.h' '***.c' > diff_origin_master_cc
git diff -U0 origin/main > diff_origin_main
git diff -U0 origin/main -- '***.cc' '***.h' '***.c' > diff_origin_main_cc

git diff -U0 HEAD~10 > diff_head
git diff -U0 HEAD~10 -- '***.cc' '***.h' '***.c' > diff_head_cc
2 changes: 1 addition & 1 deletion scripts/load_dev_db.sh
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ bazel run -c opt //src/utils/artifacts/versions_gen:versions_gen -- \
bazel run -c opt //src/utils/artifacts/artifact_db_updater:artifact_db_updater -- \
--versions_file "${versions_file}" --postgres_db "pl"

git checkout master "$versions_file"
git checkout main "$versions_file"

# Update database with SSL certs.
bazel run -c opt //src/cloud/dnsmgr/load_certs:load_certs -- \
Expand Down
4 changes: 2 additions & 2 deletions scripts/run_clang_tidy.sh
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ build=true
# Print out the usage information and exit.
usage() {
echo "Usage $0 [-d] [-h] [-f file_name] [-n]" 1>&2;
echo " -d Run only diff against master branch"
echo " -d Run only diff against main branch"
echo " -f Use a diff file"
echo " -n Don't run the build"
echo " -h Print help and exit"
Expand Down Expand Up @@ -105,7 +105,7 @@ fi
# Actually invoke clang-tidy.
if [ "$diff_mode" = true ] ; then
if [ -z "$diff_file" ] ; then
git diff -U0 origin/master -- src | "${clang_tidy_script}" -p1 2>&1 | tee clang_tidy.log
git diff -U0 origin/main -- src | "${clang_tidy_script}" -p1 2>&1 | tee clang_tidy.log
else
cat ${diff_file} | "${clang_tidy_script}" -p1 2>&1 | tee clang_tidy.log
fi
Expand Down

0 comments on commit 3554b49

Please sign in to comment.