diff --git a/.github/ISSUE_TEMPLATE/sprint_issue.md b/.github/ISSUE_TEMPLATE/sprint_issue.md deleted file mode 100644 index 30b5e16ff..000000000 --- a/.github/ISSUE_TEMPLATE/sprint_issue.md +++ /dev/null @@ -1,58 +0,0 @@ ---- -name: New sprint issue -about: ⚠️ Should only be used by the engine team ⚠️ -title: '' -labels: 'missing usage in PRD, impacts docs' -assignees: '' - ---- - -Related product team resources: [PRD]() (_internal only_) -Related product discussion: - -## Motivation - - - -## Usage - - - -## TODO - - - -### Are you modifying a database? -- [ ] If not, add the `no db change` label to your PR, and you're good to merge. -- [ ] If yes, add the `db change` label to your PR. You'll receive a message explaining you what to do. - -### Reminders when modifying the API - -- [ ] Update the openAPI file with utoipa: - - [ ] If a new module has been introduced, create a new structure deriving [the OpenAPI proc-macro](https://docs.rs/utoipa/latest/utoipa/derive.OpenApi.html) and nest it in the main [openAPI structure](https://github.com/meilisearch/meilisearch/blob/f2185438eed60fa32d25b15480c5ee064f6fba4a/crates/meilisearch/src/routes/mod.rs#L64-L78). - - [ ] If a new route has been introduced, add the [path decorator](https://docs.rs/utoipa/latest/utoipa/attr.path.html) to it and add the route at the top of the file in its openAPI structure. - - [ ] If a structure which is deserialized or serialized in the API has been introduced or modified, it must derive the [`schema`](https://docs.rs/utoipa/latest/utoipa/macro.schema.html) or the [`IntoParams`](https://docs.rs/utoipa/latest/utoipa/derive.IntoParams.html) proc-macro. - If it's a **new** structure you must also add it to the big list of structures [in the main `OpenApi` structure](https://github.com/meilisearch/meilisearch/blob/f2185438eed60fa32d25b15480c5ee064f6fba4a/crates/meilisearch/src/routes/mod.rs#L88). - - [ ] Once everything is done, start Meilisearch with the swagger flag: `cargo run --features swagger`, open `http://localhost:7700/scalar` on your browser, and ensure everything works as expected. - - For more info, refer to [this presentation](https://pitch.com/v/generating-the-openapi-file-jrn3nh). - -### Reminders when modifying the Setting API - - - -- [ ] Ensure the new setting route is at least tested by the [`test_setting_routes` macro](https://github.com/meilisearch/meilisearch/blob/5204c0b60b384cbc79621b6b2176fca086069e8e/meilisearch/tests/settings/get_settings.rs#L276) -- [ ] Ensure Analytics are fully implemented - - [ ] `/settings/my-new-setting` configurated in the [`make_setting_routes` macro](https://github.com/meilisearch/meilisearch/blob/5204c0b60b384cbc79621b6b2176fca086069e8e/meilisearch/src/routes/indexes/settings.rs#L141-L165) - - [ ] global `/settings` route configurated in the [`update_all` function](https://github.com/meilisearch/meilisearch/blob/5204c0b60b384cbc79621b6b2176fca086069e8e/meilisearch/src/routes/indexes/settings.rs#L655-L751) -- [ ] Ensure the dump serializing is consistent with the `/settings` route serializing, e.g., enums case can be different (`camelCase` in route and `PascalCase` in the dump) - -#### Special cases when adding a setting for an experimental feature - -- [ ] ⚠️ API stability: The setting does not appear on the main settings route when the feature has never been enabled (e.g. mark it `Unset` when returned from the index in this situation. See [an example](https://github.com/meilisearch/meilisearch/blob/7a89abd2a025606a42f8b219e539117eb2eb029f/meilisearch-types/src/settings.rs#L608)) -- [ ] The setting cannot be set when the feature is disabled, either by the main settings route or the subroute (see [`validate_settings` function](https://github.com/meilisearch/meilisearch/blob/7a89abd2a025606a42f8b219e539117eb2eb029f/meilisearch/src/routes/indexes/settings.rs#L811)) -- [ ] If possible, the setting is reset when the feature is disabled (hard if it requires reindexing) - -## Impacted teams - - - diff --git a/.github/workflows/check-valid-milestone.yml b/.github/workflows/check-valid-milestone.yml deleted file mode 100644 index 91d2daa8e..000000000 --- a/.github/workflows/check-valid-milestone.yml +++ /dev/null @@ -1,100 +0,0 @@ -name: PR Milestone Check - -on: - pull_request: - types: [opened, reopened, edited, synchronize, milestoned, demilestoned] - branches: - - "main" - - "release-v*.*.*" - -jobs: - check-milestone: - name: Check PR Milestone - runs-on: ubuntu-latest - - steps: - - name: Checkout code - uses: actions/checkout@v3 - - - name: Validate PR milestone - uses: actions/github-script@v7 - with: - github-token: ${{ secrets.GITHUB_TOKEN }} - script: | - // Get PR number directly from the event payload - const prNumber = context.payload.pull_request.number; - - // Get PR details - const { data: prData } = await github.rest.pulls.get({ - owner: 'meilisearch', - repo: 'meilisearch', - pull_number: prNumber - }); - - // Get base branch name - const baseBranch = prData.base.ref; - console.log(`Base branch: ${baseBranch}`); - - // Get PR milestone - const prMilestone = prData.milestone; - if (!prMilestone) { - core.setFailed('PR must have a milestone assigned'); - return; - } - console.log(`PR milestone: ${prMilestone.title}`); - - // Validate milestone format: vx.y.z - const milestoneRegex = /^v\d+\.\d+\.\d+$/; - if (!milestoneRegex.test(prMilestone.title)) { - core.setFailed(`Milestone "${prMilestone.title}" does not follow the required format vx.y.z`); - return; - } - - // For main branch PRs, check if the milestone is the highest one - if (baseBranch === 'main') { - // Get all milestones - const { data: milestones } = await github.rest.issues.listMilestones({ - owner: 'meilisearch', - repo: 'meilisearch', - state: 'open', - sort: 'due_on', - direction: 'desc' - }); - - // Sort milestones by version number (vx.y.z) - const sortedMilestones = milestones - .filter(m => milestoneRegex.test(m.title)) - .sort((a, b) => { - const versionA = a.title.substring(1).split('.').map(Number); - const versionB = b.title.substring(1).split('.').map(Number); - - // Compare major version - if (versionA[0] !== versionB[0]) return versionB[0] - versionA[0]; - // Compare minor version - if (versionA[1] !== versionB[1]) return versionB[1] - versionA[1]; - // Compare patch version - return versionB[2] - versionA[2]; - }); - - if (sortedMilestones.length === 0) { - core.setFailed('No valid milestones found in the repository. Please create at least one milestone with the format vx.y.z'); - return; - } - - const highestMilestone = sortedMilestones[0]; - console.log(`Highest milestone: ${highestMilestone.title}`); - - if (prMilestone.title !== highestMilestone.title) { - core.setFailed(`PRs targeting the main branch must use the highest milestone (${highestMilestone.title}), but this PR uses ${prMilestone.title}`); - return; - } - } else { - // For release branches, the milestone should match the branch version - const branchVersion = baseBranch.substring(8); // remove 'release-' - if (prMilestone.title !== branchVersion) { - core.setFailed(`PRs targeting release branch "${baseBranch}" must use the matching milestone "${branchVersion}", but this PR uses "${prMilestone.title}"`); - return; - } - } - - console.log('PR milestone validation passed!'); diff --git a/.github/workflows/milestone-workflow.yml b/.github/workflows/milestone-workflow.yml deleted file mode 100644 index f2841c97e..000000000 --- a/.github/workflows/milestone-workflow.yml +++ /dev/null @@ -1,224 +0,0 @@ -name: Milestone's workflow - -# /!\ No git flow are handled here - -# For each Milestone created (not opened!), and if the release is NOT a patch release (only the patch changed) -# - the roadmap issue is created, see https://github.com/meilisearch/engine-team/blob/main/issue-templates/roadmap-issue.md -# - the changelog issue is created, see https://github.com/meilisearch/engine-team/blob/main/issue-templates/changelog-issue.md -# - update the ruleset to add the current release version to the list of allowed versions and be able to use the merge queue. - -# For each Milestone closed -# - the `release_version` label is created -# - this label is applied to all issues/PRs in the Milestone - -on: - milestone: - types: [created, closed] - -env: - MILESTONE_VERSION: ${{ github.event.milestone.title }} - MILESTONE_URL: ${{ github.event.milestone.html_url }} - MILESTONE_DUE_ON: ${{ github.event.milestone.due_on }} - GH_TOKEN: ${{ secrets.MEILI_BOT_GH_PAT }} - -jobs: - # ----------------- - # MILESTONE CREATED - # ----------------- - - get-release-version: - if: github.event.action == 'created' - runs-on: ubuntu-latest - outputs: - is-patch: ${{ steps.check-patch.outputs.is-patch }} - steps: - - uses: actions/checkout@v3 - - name: Check if this release is a patch release only - id: check-patch - run: | - echo version: $MILESTONE_VERSION - if [[ $MILESTONE_VERSION =~ ^v[0-9]+\.[0-9]+\.0$ ]]; then - echo 'This is NOT a patch release' - echo "is-patch=false" >> $GITHUB_OUTPUT - elif [[ $MILESTONE_VERSION =~ ^v[0-9]+\.[0-9]+\.[0-9]+$ ]]; then - echo 'This is a patch release' - echo "is-patch=true" >> $GITHUB_OUTPUT - else - echo "Not a valid format of release, check the Milestone's title." - echo 'Should be vX.Y.Z' - exit 1 - fi - - create-roadmap-issue: - needs: get-release-version - # Create the roadmap issue if the release is not only a patch release - if: github.event.action == 'created' && needs.get-release-version.outputs.is-patch == 'false' - runs-on: ubuntu-latest - env: - ISSUE_TEMPLATE: issue-template.md - steps: - - uses: actions/checkout@v3 - - name: Download the issue template - run: curl -s https://raw.githubusercontent.com/meilisearch/engine-team/main/issue-templates/roadmap-issue.md > $ISSUE_TEMPLATE - - name: Replace all empty occurrences in the templates - run: | - # Replace all <> occurrences - sed -i "s/<>/$MILESTONE_VERSION/g" $ISSUE_TEMPLATE - - # Replace all <> occurrences - milestone_id=$(echo $MILESTONE_URL | cut -d '/' -f 7) - sed -i "s/<>/$milestone_id/g" $ISSUE_TEMPLATE - - # Replace release date if exists - if [[ ! -z $MILESTONE_DUE_ON ]]; then - date=$(echo $MILESTONE_DUE_ON | cut -d 'T' -f 1) - sed -i "s/Release date\: 20XX-XX-XX/Release date\: $date/g" $ISSUE_TEMPLATE - fi - - name: Create the issue - run: | - gh issue create \ - --title "$MILESTONE_VERSION ROADMAP" \ - --label 'epic,impacts docs,impacts integrations,impacts cloud' \ - --body-file $ISSUE_TEMPLATE \ - --milestone $MILESTONE_VERSION - - create-changelog-issue: - needs: get-release-version - # Create the changelog issue if the release is not only a patch release - if: github.event.action == 'created' && needs.get-release-version.outputs.is-patch == 'false' - runs-on: ubuntu-latest - env: - ISSUE_TEMPLATE: issue-template.md - steps: - - uses: actions/checkout@v3 - - name: Download the issue template - run: curl -s https://raw.githubusercontent.com/meilisearch/engine-team/main/issue-templates/changelog-issue.md > $ISSUE_TEMPLATE - - name: Replace all empty occurrences in the templates - run: | - # Replace all <> occurrences - sed -i "s/<>/$MILESTONE_VERSION/g" $ISSUE_TEMPLATE - - # Replace all <> occurrences - milestone_id=$(echo $MILESTONE_URL | cut -d '/' -f 7) - sed -i "s/<>/$milestone_id/g" $ISSUE_TEMPLATE - - name: Create the issue - run: | - gh issue create \ - --title "Create release changelogs for $MILESTONE_VERSION" \ - --label 'impacts docs,documentation' \ - --body-file $ISSUE_TEMPLATE \ - --milestone $MILESTONE_VERSION \ - --assignee curquiza - - create-update-version-issue: - needs: get-release-version - # Create the update-version issue even if the release is a patch release - if: github.event.action == 'created' - runs-on: ubuntu-latest - env: - ISSUE_TEMPLATE: issue-template.md - steps: - - uses: actions/checkout@v3 - - name: Download the issue template - run: curl -s https://raw.githubusercontent.com/meilisearch/engine-team/main/issue-templates/update-version-issue.md > $ISSUE_TEMPLATE - - name: Create the issue - run: | - gh issue create \ - --title "Update version in Cargo.toml for $MILESTONE_VERSION" \ - --label 'maintenance' \ - --body-file $ISSUE_TEMPLATE \ - --milestone $MILESTONE_VERSION - - create-update-openapi-issue: - needs: get-release-version - # Create the openAPI issue if the release is not only a patch release - if: github.event.action == 'created' && needs.get-release-version.outputs.is-patch == 'false' - runs-on: ubuntu-latest - env: - ISSUE_TEMPLATE: issue-template.md - steps: - - uses: actions/checkout@v3 - - name: Download the issue template - run: curl -s https://raw.githubusercontent.com/meilisearch/engine-team/main/issue-templates/update-openapi-issue.md > $ISSUE_TEMPLATE - - name: Create the issue - run: | - gh issue create \ - --title "Update Open API file for $MILESTONE_VERSION" \ - --label 'maintenance' \ - --body-file $ISSUE_TEMPLATE \ - --milestone $MILESTONE_VERSION - - update-ruleset: - runs-on: ubuntu-latest - if: github.event.action == 'created' - steps: - - uses: actions/checkout@v3 - - name: Install jq - run: | - sudo apt-get update - sudo apt-get install -y jq - - name: Update ruleset - env: - # gh api repos/meilisearch/meilisearch/rulesets --jq '.[] | {name: .name, id: .id}' - RULESET_ID: 4253297 - BRANCH_NAME: ${{ github.event.inputs.branch_name }} - run: | - echo "RULESET_ID: ${{ env.RULESET_ID }}" - echo "BRANCH_NAME: ${{ env.BRANCH_NAME }}" - - # Get current ruleset conditions - CONDITIONS=$(gh api repos/meilisearch/meilisearch/rulesets/${{ env.RULESET_ID }} --jq '{ conditions: .conditions }') - - # Update the conditions by appending the milestone version - UPDATED_CONDITIONS=$(echo $CONDITIONS | jq '.conditions.ref_name.include += ["refs/heads/release-'${{ env.MILESTONE_VERSION }}'"]') - - # Update the ruleset from stdin (-) - echo $UPDATED_CONDITIONS | - gh api repos/meilisearch/meilisearch/rulesets/${{ env.RULESET_ID }} \ - --method PUT \ - -H "Accept: application/vnd.github+json" \ - -H "X-GitHub-Api-Version: 2022-11-28" \ - --input - - - # ---------------- - # MILESTONE CLOSED - # ---------------- - - create-release-label: - if: github.event.action == 'closed' - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v3 - - name: Create the ${{ env.MILESTONE_VERSION }} label - run: | - label_description="PRs/issues solved in $MILESTONE_VERSION" - if [[ ! -z $MILESTONE_DUE_ON ]]; then - date=$(echo $MILESTONE_DUE_ON | cut -d 'T' -f 1) - label_description="$label_description released on $date" - fi - - gh api repos/meilisearch/meilisearch/labels \ - --method POST \ - -H "Accept: application/vnd.github+json" \ - -f name="$MILESTONE_VERSION" \ - -f description="$label_description" \ - -f color='ff5ba3' - - labelize-all-milestone-content: - if: github.event.action == 'closed' - needs: create-release-label - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v3 - - name: Add label ${{ env.MILESTONE_VERSION }} to all PRs in the Milestone - run: | - prs=$(gh pr list --search milestone:"$MILESTONE_VERSION" --limit 1000 --state all --json number --template '{{range .}}{{tablerow (printf "%v" .number)}}{{end}}') - for pr in $prs; do - gh pr edit $pr --add-label $MILESTONE_VERSION - done - - name: Add label ${{ env.MILESTONE_VERSION }} to all issues in the Milestone - run: | - issues=$(gh issue list --search milestone:"$MILESTONE_VERSION" --limit 1000 --state all --json number --template '{{range .}}{{tablerow (printf "%v" .number)}}{{end}}') - for issue in $issues; do - gh issue edit $issue --add-label $MILESTONE_VERSION - done