apiVersion: api/v1
kind: Case
name: br_compatibility
features: [ br ]
summary: |
    The newest version of BR should be able to restore at previous version of BR.
    Please bump the `current_version` when version of TiDB bumped.
steps: |
    1. Use BR previous version to backup/restore the newest TiDB
    2. Use newest BR to backup/restore previous version TiDB

priority: P1
supportedVersions: [ ">=5.3" ]
designer: yujuncen@pingcap.com
automation: AUTOMATED
active: true
framework:
    generic:
        command: [ "/br-compatibility-to-prev-version" ]
        workingDir: "/"
        env: null
        image: hub.pingcap.net/tools/br-compatibility-to-prev-version
        imagePullPolicy: Always
parameters:
    -   type: RESOURCE
        name: src_tidb
        default: src-tidb
    -   type: RESOURCE
        name: dst_tidb
        default: dst-tidb
    -   type: RESOURCE
        name: br
        default: br
    -   type: RESOURCE
        name: lightning
        default: lightning
    -   type: RESOURCE
        name: mc 
        default: mc
    -   type: STRING
        name: br_opts
        default: |
            {"storage":"s3://tmp/br-backup-basic?access-key=minioadmin&secret-access-key=minioadmin&endpoint=http%3a%2f%2fminio.pingcap.net%3a9000&force-path-style=true","timeout":"10m","crc32-checksum":0,"database":"clustered"}
    -   type: STRING
        name: import_basic_opts
        default: |
            {"data-dir":"s3://nfs/jianxu/test-data?access-key=minioadmin&secret-access-key=minioadmin&endpoint=http%3a%2f%2fminio.pingcap.net%3a9000&force-path-style=true","backend":"local","sorted-kv-dir":"/tmp/sorted-kv-dir", "timeout":"10m","crc32-checksum":312456081}
    -   type: STRING
        name: mc_rm_opts
        default: |
            {"path":"qa-minio/tmp/br-backup-basic","timeout":"10m"}
    -   type: STRING
        name: global_variable
        default: |
            [{"name": "tidb_enable_clustered_index", "value": "on"}, {"name": "tidb_row_format_version", "value": "1"}]
    -   type: STRING
        name: current_version
        default: 5.3.0-pre
    -   type: STRING
        name: previous_version
        default: 5.2.0
    -   type: STRING
        name: admin_check
        default: []
    