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

Commit 72bec72

Browse files
committed
Prepare to switch master branch for main. (apache#14688)
There are many more references to "master" (even in our own repo) than this, but this commit is the first step: to that process. It makes CI run on the main branch (once it exists), re-words a few cases where we can to easily not refer to master anymore. This doesn't yet re-name the `constraints-master` or `master-*` images - that will be done in a future PR. (We don't be able to entirely eliminate "master" from our repo as we refer to a lot of other GitHub repos that we can't change.) (cherry picked from commit 0dea083)
1 parent 0e8fb85 commit 72bec72

16 files changed

+57
-50
lines changed

.asf.yaml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,9 @@ github:
4444
master:
4545
required_pull_request_reviews:
4646
required_approving_review_count: 1
47+
main:
48+
required_pull_request_reviews:
49+
required_approving_review_count: 1
4750
v1-10-stable:
4851
required_pull_request_reviews:
4952
required_approving_review_count: 1

.github/workflows/codeql-analysis.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ name: "CodeQL"
2020

2121
on: # yamllint disable-line rule:truthy
2222
push:
23-
branches: [master]
23+
branches: [master, main]
2424
schedule:
2525
- cron: '0 2 * * *'
2626

.github/workflows/scheduled_quarantined.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,7 @@ jobs:
7272
with:
7373
python-version: '3.7'
7474
- name: "Set issue id for master"
75-
if: github.ref == 'refs/heads/master'
75+
if: github.ref == 'refs/heads/master' || github.ref == 'refs/heads/main'
7676
run: |
7777
echo "ISSUE_ID=10118" >> $GITHUB_ENV
7878
- name: "Set issue id for v1-10-stable"

Dockerfile

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -204,8 +204,8 @@ ENV AIRFLOW_PRE_CACHED_PIP_PACKAGES=${AIRFLOW_PRE_CACHED_PIP_PACKAGES}
204204
ARG INSTALL_PROVIDERS_FROM_SOURCES="false"
205205
ENV INSTALL_PROVIDERS_FROM_SOURCES=${INSTALL_PROVIDERS_FROM_SOURCES}
206206

207-
# Only copy install_airflow_from_latest_master.sh to not invalidate cache on other script changes
208-
COPY scripts/docker/install_airflow_from_latest_master.sh /scripts/docker/install_airflow_from_latest_master.sh
207+
# Only copy install_airflow_from_branch_tip.sh to not invalidate cache on other script changes
208+
COPY scripts/docker/install_airflow_from_branch_tip.sh /scripts/docker/install_airflow_from_branch_tip.sh
209209

210210
# By default we do not upgrade to latest dependencies
211211
ARG UPGRADE_TO_NEWER_DEPENDENCIES="false"
@@ -219,7 +219,7 @@ ENV UPGRADE_TO_NEWER_DEPENDENCIES=${UPGRADE_TO_NEWER_DEPENDENCIES}
219219
# account for removed dependencies (we do not install them in the first place)
220220
RUN if [[ ${AIRFLOW_PRE_CACHED_PIP_PACKAGES} == "true" && \
221221
${UPGRADE_TO_NEWER_DEPENDENCIES} == "false" ]]; then \
222-
bash /scripts/docker/install_airflow_from_latest_master.sh; \
222+
bash /scripts/docker/install_airflow_from_branch_tip.sh; \
223223
fi
224224

225225
# By default we install latest airflow from PyPI so we do not need to copy sources of Airflow

Dockerfile.ci

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -241,12 +241,12 @@ RUN echo "Installing with extras: ${AIRFLOW_EXTRAS}."
241241
ARG CONSTRAINTS_GITHUB_REPOSITORY="apache/airflow"
242242
ENV CONSTRAINTS_GITHUB_REPOSITORY=${CONSTRAINTS_GITHUB_REPOSITORY}
243243

244-
ARG AIRFLOW_CONSTRAINTS_REFERENCE="constraints-master"
244+
ARG AIRFLOW_CONSTRAINTS_REFERENCE="constraints-${AIRFLOW_BRANCH}"
245245
ARG AIRFLOW_CONSTRAINTS="constraints"
246246
ARG AIRFLOW_CONSTRAINTS_LOCATION="https://raw.githubusercontent.com/${CONSTRAINTS_GITHUB_REPOSITORY}/${AIRFLOW_CONSTRAINTS_REFERENCE}/${AIRFLOW_CONSTRAINTS}-${PYTHON_MAJOR_MINOR_VERSION}.txt"
247247
ENV AIRFLOW_CONSTRAINTS_LOCATION=${AIRFLOW_CONSTRAINTS_LOCATION}
248248

249-
# By changing the CI build epoch we can force reinstalling Airflow from the current master
249+
# By changing the CI build epoch we can force reinstalling Airflow and pip all dependencies
250250
# It can also be overwritten manually by setting the AIRFLOW_CI_BUILD_EPOCH environment variable.
251251
ARG AIRFLOW_CI_BUILD_EPOCH="3"
252252
ENV AIRFLOW_CI_BUILD_EPOCH=${AIRFLOW_CI_BUILD_EPOCH}
@@ -292,8 +292,8 @@ ENV PIP_PROGRESS_BAR=${PIP_PROGRESS_BAR}
292292

293293
RUN pip install --no-cache-dir --upgrade "pip==${AIRFLOW_PIP_VERSION}"
294294

295-
# Only copy install_airflow_from_latest_master.sh to not invalidate cache on other script changes
296-
COPY scripts/docker/install_airflow_from_latest_master.sh /scripts/docker/install_airflow_from_latest_master.sh
295+
# Only copy install_airflow_from_branch_tip.sh to not invalidate cache on other script changes
296+
COPY scripts/docker/install_airflow_from_branch_tip.sh /scripts/docker/install_airflow_from_branch_tip.sh
297297

298298
ARG UPGRADE_TO_NEWER_DEPENDENCIES="false"
299299
ENV UPGRADE_TO_NEWER_DEPENDENCIES=${UPGRADE_TO_NEWER_DEPENDENCIES}
@@ -307,7 +307,7 @@ ENV UPGRADE_TO_NEWER_DEPENDENCIES=${UPGRADE_TO_NEWER_DEPENDENCIES}
307307
# account for removed dependencies (we do not install them in the first place)
308308
RUN if [[ ${AIRFLOW_PRE_CACHED_PIP_PACKAGES} == "true" && \
309309
${UPGRADE_TO_NEWER_DEPENDENCIES} == "false" ]]; then \
310-
bash /scripts/docker/install_airflow_from_latest_master.sh; \
310+
bash /scripts/docker/install_airflow_from_branch_tip.sh; \
311311
fi
312312

313313
# Generate random hex dump file so that we can determine whether it's faster to rebuild the image

chart/templates/create-user-job.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@ spec:
6767
args:
6868
- "bash"
6969
- "-c"
70-
# Support running against 1.10.x and 2.0.0dev/master
70+
# Support running against 1.10.x and 2.x
7171
- 'airflow users create "$@" || airflow create_user "$@"'
7272
- --
7373
- "-r"

chart/templates/migrate-database-job.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ spec:
6363
- name: run-airflow-migrations
6464
image: {{ template "airflow_image" . }}
6565
imagePullPolicy: {{ .Values.images.airflow.pullPolicy }}
66-
# Support running against 1.10.x and 2.0.0dev/master
66+
# Support running against 1.10.x and 2.x
6767
args: ["bash", "-c", "airflow db upgrade || airflow upgradedb"]
6868
envFrom:
6969
{{- include "custom_airflow_environment_from" . | default "\n []" | indent 10 }}

codecov.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,7 @@ coverage:
3737
# advanced
3838
branches:
3939
- master
40+
- main
4041
- v1-10-stable
4142
- v1-10-test
4243
- v2-0-test
@@ -53,6 +54,7 @@ coverage:
5354
# advanced
5455
branches:
5556
- master
57+
- main
5658
- v1-10-stable
5759
- v1-10-test
5860
- v2-0-test

docs/README.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ For Helm Chart, see: `/chart/README.md <../chart/READMe.md>`__
2525
Development documentation preview
2626
==================================
2727

28-
Documentation from the ``master`` branch is built and automatically published: `s.apache.org/airflow-docs <https://s.apache.org/airflow-docs>`_
28+
Documentation from the development version is built and automatically published: `s.apache.org/airflow-docs <https://s.apache.org/airflow-docs>`_
2929

3030
Documentation for your PRs is available as downloadable artifact in GitHub Actions after the CI builds your PR.
3131

docs/conf.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -76,10 +76,10 @@
7676
except StopIteration:
7777
raise Exception(f"Could not find provider.yaml file for package: {PACKAGE_NAME}")
7878
PACKAGE_DIR = CURRENT_PROVIDER['package-dir']
79-
PACKAGE_VERSION = 'master'
79+
PACKAGE_VERSION = 'devel'
8080
else:
8181
PACKAGE_DIR = None
82-
PACKAGE_VERSION = 'master'
82+
PACKAGE_VERSION = 'devel'
8383
# Adds to environment variables for easy access from other plugins like airflow_intersphinx.
8484
os.environ['AIRFLOW_PACKAGE_NAME'] = PACKAGE_NAME
8585
if PACKAGE_DIR:
@@ -302,8 +302,8 @@ def _get_rst_filepath_from_path(filepath: str):
302302
'conf_py_path': f'/docs/{PACKAGE_NAME}/',
303303
'github_user': 'apache',
304304
'github_repo': 'airflow',
305-
'github_version': 'master',
306-
'display_github': 'master',
305+
'github_version': 'devel',
306+
'display_github': 'devel',
307307
'suffix': '.rst',
308308
}
309309

0 commit comments

Comments
 (0)