Skip to content

Commit d26e355

Browse files
authored
Avoid running packaging tasks during GitHub operations (#1305)
1 parent 5079fcc commit d26e355

File tree

3 files changed

+29
-5
lines changed

3 files changed

+29
-5
lines changed

.evergreen/config_generator/components/packaging.py

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,11 @@
22

33
from config_generator.etc.distros import find_large_distro
44
from config_generator.etc.function import Function, merge_defns
5-
from config_generator.etc.utils import bash_exec
5+
from config_generator.etc.utils import Task, bash_exec
66

77
from shrub.v3.evg_build_variant import BuildVariant
88
from shrub.v3.evg_command import EvgCommandType, s3_put
9-
from shrub.v3.evg_task import EvgTask, EvgTaskRef
9+
from shrub.v3.evg_task import EvgTaskRef
1010

1111

1212
TAG = 'packaging'
@@ -78,10 +78,19 @@ def functions():
7878

7979
def tasks():
8080
return [
81-
EvgTask(
81+
Task(
8282
name=f'{TAG}-{fn.desc}',
8383
tags=[TAG, distro_name],
8484
run_on=find_large_distro(distro_name).name,
85+
allowed_requesters=[
86+
'ad_hoc',
87+
'commit',
88+
# 'github_merge_queue'
89+
# 'github_pr',
90+
# 'github_tag',
91+
'patch',
92+
'trigger',
93+
],
8594
commands=[
8695
Setup.call(),
8796
fn.call(),

.evergreen/config_generator/etc/utils.py

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,19 +3,24 @@
33
from inspect import isclass
44
from pathlib import Path
55
from textwrap import dedent
6-
from typing import (Any, Iterable, Literal, Mapping, Type, TypeVar,
6+
from typing import (Any, Iterable, List, Literal, Mapping, Optional, Type, TypeVar,
77
Union, cast)
88

99
import yaml
1010
from shrub.v3.evg_command import EvgCommandType, KeyValueParam, subprocess_exec
1111
from shrub.v3.evg_project import EvgProject
1212
from shrub.v3.shrub_service import ConfigDumper
13-
from shrub.v3.evg_task import EvgTaskRef
13+
from shrub.v3.evg_task import EvgTask
1414
from typing_extensions import get_args, get_origin, get_type_hints
1515

1616
T = TypeVar('T')
1717

1818

19+
# Equivalent to EvgTask but defines additional properties.
20+
class Task(EvgTask):
21+
allowed_requesters: Optional[List[str]] = None
22+
23+
1924
# Automatically formats the provided script and invokes it in Bash.
2025
def bash_exec(
2126
script,

.evergreen/generated_configs/tasks.yml

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4010,12 +4010,22 @@ tasks:
40104010
- name: packaging-debian
40114011
run_on: debian12-latest-large
40124012
tags: [packaging, debian12-latest]
4013+
allowed_requesters:
4014+
- ad_hoc
4015+
- commit
4016+
- patch
4017+
- trigger
40134018
commands:
40144019
- func: setup
40154020
- func: build-package-debian
40164021
- name: packaging-rpm
40174022
run_on: rhel92-arm64-large
40184023
tags: [packaging, rhel92-arm64]
4024+
allowed_requesters:
4025+
- ad_hoc
4026+
- commit
4027+
- patch
4028+
- trigger
40194029
commands:
40204030
- func: setup
40214031
- func: build-package-rpm

0 commit comments

Comments
 (0)