#test policy file
#earlier = higher precedence!

[main]
; For Kerberos authentication
; the principal to connect with
principal=koji-gc/koji{{env_suffix}}.fedoraproject.org@{{ipa_realm}}
; The location of the keytab for the principal above
keytab=/etc/krb5.koji-gc_koji{{env_suffix}}.fedoraproject.org.keytab
krb_rdns = False
smtp_host = bastion.iad2.fedoraproject.org

key_aliases =
    30C9ECF8    fedora-test
    4F2A6FD2    fedora-gold
    897DA07A    redhat-beta
    1AC70CE6    fedora-extras
    6DF2196F    fedora-8-9
    DF9B0AE9    fedora-8-9-test
    0B86274E    fedora-10-test
    4EBFC273    fedora-10
    D22E77F2    fedora-11
    57BBCCBA    fedora-12
    E8E40FDE    fedora-13
    97A1071F    fedora-14
    069C8460    fedora-15
    A82BA4B7    fedora-16
    1ACA3465    fedora-17
    DE7F38BD    fedora-18
    FB4B18E6    fedora-19
    246110C1    fedora-20
    95A43F54    fedora-21
    8E1431D5    fedora-22
    34EC9CBA    fedora-23
    81B46521    fedora-24
    FDB19C98    fedora-25
    64DAB85D    fedora-26
    F5282EE4    fedora-27
    9DB62FB1    fedora-28
    429476B4    fedora-29
    CFC659B9    fedora-30
    3C3359C4    fedora-31
    12C944D0    fedora-32
    9570ff31    fedora-33
    45719a39    fedora-34
    9867C58F    fedora-35
    38ab71f4    fedora-36
    5323552a    fedora-37
    eb10b464    fedora-38
    18b8e74c    fedora-39
    a15b79cc    fedora-40
    e99d6ad1    fedora-41
    DBBDCF7C    fedora-iot-2019
    217521F6    fedora-epel
    0608B895    fedora-epel-6
    352C64E5    fedora-epel-7
    2F86D6A1    fedora-epel-8
    A3CC4E62    fedora-modularity

unprotected_keys =
    fedora-15
    fedora-16
    fedora-17
    fedora-18
    fedora-19
    fedora-20
    fedora-21
    fedora-22
    fedora-23
    fedora-24
    fedora-25
    fedora-26
    fedora-27
    fedora-28
    fedora-29
    fedora-30
    fedora-31
    fedora-32
    fedora-33
    fedora-34
    fedora-35
    fedora-36
    fedora-37
    fedora-38
    fedora-39
    fedora-40
    fedora-41
    fedora-iot-2019
    fedora-extras
    redhat-beta
    fedora-epel
    fedora-epel-6
    fedora-epel-7
    fedora-epel-8
    fedora-modularity

server = {{ koji_server_url }}
serverca = /etc/pki/ca-trust/extracted/pem/tls-ca-bundle.pem
weburl = {{ koji_weburl }}
from_addr = Koji Build System <buildsys@fedoraproject.org>

[prune]
policy =
    # At this moment, all of modularity is off limits to GC
    # Modularity with koji-gc is not working correctly.
    # The specific problem: if you build pkga stream 1, 2 and 3, it will see
    # the stream 2 and 3 as later order builds for pkga, and then it assumes
    # it can clean up pkga stream 1
    tag *-modular-* :: keep
    tag module-* :: keep
    tag *-modular :: keep

    # coreos-pool is used for coreos releases, keep it always
    tag coreos-pool :: keep

    #stuff to protect
    #note that tags with master lock engaged are already protected
    tag *-updates :: keep
    age < 1 day :: skip
    sig fedora-gold :: skip
    sig fedora-test && age < 12 weeks :: keep
    sig fedora-10-test && age < 12 weeks :: keep
    sig fedora-10 && age < 12 weeks :: keep
    sig fedora-11 && age < 12 weeks :: keep
    sig fedora-12 && age < 12 weeks :: keep
    sig fedora-13 && age < 12 weeks :: keep
    sig fedora-14 && age < 12 weeks :: keep
    sig fedora-15 && age < 12 weeks :: keep
    sig fedora-16 && age < 12 weeks :: keep
    sig fedora-17 && age < 12 weeks :: keep
    sig fedora-18 && age < 12 weeks :: keep
    sig fedora-19 && age < 12 weeks :: keep
    sig fedora-20 && age < 12 weeks :: keep
    sig fedora-21 && age < 12 weeks :: keep
    sig fedora-22 && age < 12 weeks :: keep
    sig fedora-23 && age < 12 weeks :: keep
    sig fedora-24 && age < 12 weeks :: keep
    sig fedora-25 && age < 12 weeks :: keep
    sig fedora-26 && age < 12 weeks :: keep
    sig fedora-27 && age < 12 weeks :: keep
    sig fedora-28 && age < 12 weeks :: keep
    sig fedora-29 && age < 12 weeks :: keep
    sig fedora-30 && age < 12 weeks :: keep
    sig fedora-31 && age < 12 weeks :: keep
    sig fedora-32 && age < 12 weeks :: keep
    sig fedora-33 && age < 12 weeks :: keep
    sig fedora-34 && age < 12 weeks :: keep
    sig fedora-35 && age < 12 weeks :: keep
    sig fedora-36 && age < 12 weeks :: keep
    sig fedora-37 && age < 12 weeks :: keep
    sig fedora-38 && age < 12 weeks :: keep
    sig fedora-39 && age < 12 weeks :: keep
    sig fedora-40 && age < 12 weeks :: keep
    sig fedora-41 && age < 12 weeks :: keep
    sig fedora-iot-2019 && age < 12 weeks :: keep
    sig fedora-epel && age < 12 weeks :: keep
    sig fedora-epel-6 && age < 12 weeks :: keep
    sig fedora-epel-7 && age < 12 weeks :: keep
    sig fedora-epel-8 && age < 12 weeks :: keep

    # Do not GC stuff in pending tags, it is likely just going out in an update
    tag *pending :: keep

    #stuff to chuck semi-rapidly
    tag *-testing *-candidate *-override && order >= 2 :: untag
    tag *-testing *-candidate && order > 0 && age > 6 weeks :: untag
    tag *-candidate && age > 8 weeks :: untag

    #stuff for infrastructure repositories
    tag *-infra && order >= 2 :: untag
    tag *-infra-stg && order >= 2 && age > 4 weeks :: untag

    #stuff for eln tags
    tag eln* && order >= 2 :: untag

    #default: keep the last 3
    order > 2 :: untag

