Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore(IDX): don't diff bazel targets #4197

Draft
wants to merge 1 commit into
base: master
Choose a base branch
from
Draft
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
4 changes: 1 addition & 3 deletions .github/workflows-source/ci-main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,6 @@ jobs:
# Only run ci/bazel-scripts/diff.sh on PRs that are not labeled with "CI_ALL_BAZEL_TARGETS".
OVERRIDE_DIDC_CHECK: ${{ contains(github.event.pull_request.labels.*.name, 'CI_OVERRIDE_DIDC_CHECK') }}
CI_OVERRIDE_BUF_BREAKING: ${{ contains(github.event.pull_request.labels.*.name, 'CI_OVERRIDE_BUF_BREAKING') }}
RUN_ON_DIFF_ONLY: ${{ github.event_name == 'pull_request' && !contains(github.event.pull_request.labels.*.name, 'CI_ALL_BAZEL_TARGETS') }}
steps:
- <<: *checkout
- name: Set BAZEL_EXTRA_ARGS
Expand All @@ -109,7 +108,7 @@ jobs:
nns_tests_nightly
)
if [[ "$CI_EVENT_NAME" =~ ^(pull_request|merge_group)$ ]]; then
if [[ "$CI_EVENT_NAME" == "merge_group" || "${RUN_ON_DIFF_ONLY:-}" == "true" ]]; then
if [[ "$CI_EVENT_NAME" == "merge_group" ]]; then
EXCLUDED_TEST_TAGS+=(long_test)
fi
elif [[ "$CI_EVENT_NAME" == "push" ]] && [[ "$BRANCH_NAME" =~ ^dev-gh-.* ]]; then
Expand Down Expand Up @@ -269,7 +268,6 @@ jobs:
BAZEL_TARGETS: //...
MERGE_BASE_SHA: ${{ github.event.pull_request.base.sha }}
BRANCH_HEAD_SHA: ${{ github.event.pull_request.head.sha }}
RUN_ON_DIFF_ONLY: ${{ github.event_name == 'pull_request' && !contains(github.event.pull_request.labels.*.name, 'CI_ALL_BAZEL_TARGETS') }}
- name: Upload SHA256SUMS (nocache)
uses: actions/upload-artifact@v4
with:
Expand Down
4 changes: 1 addition & 3 deletions .github/workflows/ci-main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,6 @@ jobs:
# Only run ci/bazel-scripts/diff.sh on PRs that are not labeled with "CI_ALL_BAZEL_TARGETS".
OVERRIDE_DIDC_CHECK: ${{ contains(github.event.pull_request.labels.*.name, 'CI_OVERRIDE_DIDC_CHECK') }}
CI_OVERRIDE_BUF_BREAKING: ${{ contains(github.event.pull_request.labels.*.name, 'CI_OVERRIDE_BUF_BREAKING') }}
RUN_ON_DIFF_ONLY: ${{ github.event_name == 'pull_request' && !contains(github.event.pull_request.labels.*.name, 'CI_ALL_BAZEL_TARGETS') }}
steps:
- name: Checkout
uses: actions/checkout@v4
Expand All @@ -67,7 +66,7 @@ jobs:
nns_tests_nightly
)
if [[ "$CI_EVENT_NAME" =~ ^(pull_request|merge_group)$ ]]; then
if [[ "$CI_EVENT_NAME" == "merge_group" || "${RUN_ON_DIFF_ONLY:-}" == "true" ]]; then
if [[ "$CI_EVENT_NAME" == "merge_group" ]]; then
EXCLUDED_TEST_TAGS+=(long_test)
fi
elif [[ "$CI_EVENT_NAME" == "push" ]] && [[ "$BRANCH_NAME" =~ ^dev-gh-.* ]]; then
Expand Down Expand Up @@ -304,7 +303,6 @@ jobs:
BAZEL_TARGETS: //...
MERGE_BASE_SHA: ${{ github.event.pull_request.base.sha }}
BRANCH_HEAD_SHA: ${{ github.event.pull_request.head.sha }}
RUN_ON_DIFF_ONLY: ${{ github.event_name == 'pull_request' && !contains(github.event.pull_request.labels.*.name, 'CI_ALL_BAZEL_TARGETS') }}
- name: Upload SHA256SUMS (nocache)
uses: actions/upload-artifact@v4
with:
Expand Down
73 changes: 0 additions & 73 deletions ci/bazel-scripts/diff.sh

This file was deleted.

10 changes: 0 additions & 10 deletions ci/bazel-scripts/main.sh
Original file line number Diff line number Diff line change
Expand Up @@ -23,16 +23,6 @@ done
# (with versioning)
if [[ "${IS_PROTECTED_BRANCH:-}" == "true" ]]; then
release_build="true"
RUN_ON_DIFF_ONLY="false"
fi

if [[ "${CI_EVENT_NAME:-}" == "merge_group" ]]; then
RUN_ON_DIFF_ONLY="false"
fi

if [[ "${RUN_ON_DIFF_ONLY:-}" == "true" ]]; then
# get bazel targets that changed within the MR
BAZEL_TARGETS=$("${CI_PROJECT_DIR:-}"/ci/bazel-scripts/diff.sh)
fi

# if bazel targets is empty we don't need to run any tests
Expand Down
30 changes: 1 addition & 29 deletions ci/scripts/run-build-ic.sh
Original file line number Diff line number Diff line change
Expand Up @@ -18,35 +18,7 @@ done
# run build with release on protected branches or if a pull_request is targeting an rc branch
if [ "${IS_PROTECTED_BRANCH:-}" == "true" ] || [[ "${CI_MERGE_REQUEST_TARGET_BRANCH_NAME:-}" == "rc--"* ]]; then
ci/container/build-ic.sh -i -c -b
# check if the job requested running only on diff, otherwise run full build with no release
elif [[ "${RUN_ON_DIFF_ONLY:-}" == "true" ]]; then
TARGETS=$(ci/bazel-scripts/diff.sh)
ARGS=(--no-release)

if [ "$TARGETS" == "//..." ]; then
ARGS+=(-i -c -b)
else
if grep -q "ic-os" <<<"$TARGETS"; then
ARGS+=(-i)
fi
if grep -q "publish/canisters" <<<"$TARGETS"; then
ARGS+=(-c)
fi
if grep -q "publish/binaries" <<<"$TARGETS"; then
ARGS+=(-b)
fi
fi

if [ ${#ARGS[@]} -eq 1 ]; then
if [ "${IS_PROTECTED_BRANCH:-}" == "true" ]; then
echo "Error: No changes to build on protected branch. Aborting."
exit 1
fi
echo "No changes that require building IC-OS, binaries or canisters."
exit 0
fi
ci/container/build-ic.sh "${ARGS[@]}"
# otherwise run full build but with no release
# otherwise build with no release
else
ci/container/build-ic.sh -i -c -b --no-release
fi
Loading