Skip to content

Comments

fix ordering of snapshots#14

Merged
ekohilas merged 10 commits intomainfrom
fix-order
Aug 27, 2025
Merged

fix ordering of snapshots#14
ekohilas merged 10 commits intomainfrom
fix-order

Conversation

@ekohilas
Copy link
Owner

This PR releases a new version of ci-test that fixes a bug that essentially randomised the ordering of snapshots.

Now the ordering is fixed to be alphabetical on the values after the existence of if/changes.

e.g. Without this change, the ordering would be:

[
  {
    "changes": [
      "**/*.py"
    ],
    "jobs": [
      "job-rules-if-or-changes"
    ]
  },
  {
    "if": "$CI_PIPELINE_SOURCE == 'merge_request_event'",
    "jobs": [
      "job-rules-if-or-changes"
    ]
  },
  {
    "if": "$CI_PIPELINE_SOURCE == 'push'",
    "jobs": [
      "job-rules-if"
    ]
  },
  {
    "if": "$CI_PIPELINE_SOURCE == 'merge_request_event'",
    "changes": [
      "**/*.py"
    ],
    "jobs": [
      "job-rules-if-and-changes"
    ]
  },
  {
    "changes": [
      "**/*.json"
    ],
    "jobs": [
      "job-rules-changes"
    ]
  },
  {
    "jobs": [
      "job-rules-none"
    ]
  }
]

But now the ordering is:

[
  {
    "jobs": [
      "job-rules-none"
    ]
  },
  {
    "if": "$CI_PIPELINE_SOURCE == 'merge_request_event'",
    "jobs": [
      "job-rules-if-or-changes"
    ]
  },
  {
    "if": "$CI_PIPELINE_SOURCE == 'push'",
    "jobs": [
      "job-rules-if"
    ]
  },
  {
    "changes": [
      "**/*.json"
    ],
    "jobs": [
      "job-rules-changes"
    ]
  },
  {
    "changes": [
      "**/*.py"
    ],
    "jobs": [
      "job-rules-if-or-changes"
    ]
  },
  {
    "if": "$CI_PIPELINE_SOURCE == 'merge_request_event'",
    "changes": [
      "**/*.py"
    ],
    "jobs": [
      "job-rules-if-and-changes"
    ]
  }
]

@ekohilas ekohilas merged commit 521285a into main Aug 27, 2025
5 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant