Skip to content

Commit

Permalink
Remove release branch staleness tests.
Browse files Browse the repository at this point in the history
These are now covered by our daily testing of release branches

PiperOrigin-RevId: 683438670
  • Loading branch information
mkruskal-google authored and copybara-github committed Oct 8, 2024
1 parent 4e257cf commit cdb496d
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 48 deletions.
32 changes: 0 additions & 32 deletions .github/scripts/validate_yaml.py
Original file line number Diff line number Diff line change
Expand Up @@ -65,35 +65,3 @@
% (step['name'], job)
)
print('PASSED: All steps in all jobs check the continuous-run condition.')

# Check to make sure the list of included branches matches the list of excluded
# branches in staleness_check.yml.
with open(
os.path.join(os.path.dirname(__file__), '../workflows/staleness_check.yml'),
'r',
) as f:
regex_pattern = r"'(\d+\.x)'"
data = yaml.safe_load(f)
matrix = data['jobs']['test']['strategy']['matrix']
included_branches = matrix['branch']
# Main should be included in all test runs
included_branches.remove('main')
excludes = matrix['exclude']
for entry in excludes:
match = re.search(regex_pattern, entry['branch'])
branch = match.group(1)
if branch not in included_branches:
raise ValueError(
'Branch %s is excluded for presubmit runs but is not in the list of'
' matrix branches in staleness_check.yml.' % branch
)
included_branches.remove(branch)
if included_branches:
raise ValueError(
'Branches %s are in the list of matrix branches but do not get excluded'
' for presubmit runs in staleness_check.yml.' % included_branches
)
print(
'PASSED: The list of included branches matches the list of excluded'
' branches in staleness_check.yml.'
)
20 changes: 4 additions & 16 deletions .github/workflows/staleness_check.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,26 +20,14 @@ on:
permissions: {}
jobs:
test:
strategy:
fail-fast: false
matrix:
# TODO Remove this parameterization once the release branch testing is stable.
branch: [main, 25.x, 28.x, 29.x]
os: [{ name: Linux, value: ubuntu-latest}]
exclude:
# If we are in a presubmit run, only test main
- branch: ${{ !inputs.continuous-run && '25.x' }}
- branch: ${{ !inputs.continuous-run && '28.x' }}
- branch: ${{ !inputs.continuous-run && '29.x' }}

name: Test staleness ${{ matrix.os.name }} ${{ github.head_ref && 'PR' || matrix.branch }}
runs-on: ${{ matrix.os.value }}
name: Test staleness
runs-on: ubuntu-latest
if: ${{ github.event.repository.full_name == 'protocolbuffers/protobuf' }}
steps:
- name: Checkout ${{ github.head_ref && 'PR' || matrix.branch }}
- name: Checkout
uses: protocolbuffers/protobuf-ci/checkout@v3
with:
ref: ${{ inputs.safe-checkout || github.head_ref || matrix.branch }}
ref: ${{ inputs.safe-checkout || github.head_ref || github.ref }}

- name: Mark runs associated with commits
if: ${{ github.event_name != 'schedule' && github.event_name != 'workflow_dispatch' }}
Expand Down

0 comments on commit cdb496d

Please sign in to comment.