mirror of
https://github.com/meilisearch/meilisearch.git
synced 2025-09-05 20:26:31 +00:00
Remove useless automation
This commit is contained in:
58
.github/ISSUE_TEMPLATE/sprint_issue.md
vendored
58
.github/ISSUE_TEMPLATE/sprint_issue.md
vendored
@ -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
|
|
||||||
|
|
||||||
<!---Copy/paste the information in PRD or briefly detail the product motivation. Ask product team if any hesitation.-->
|
|
||||||
|
|
||||||
## Usage
|
|
||||||
|
|
||||||
<!---Link to the public part of the PRD, or to the related product discussion for experimental features-->
|
|
||||||
|
|
||||||
## TODO
|
|
||||||
|
|
||||||
<!---If necessary, create a list with technical/product steps-->
|
|
||||||
|
|
||||||
### 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
|
|
||||||
|
|
||||||
<!--- Special steps to remind when adding a new index setting -->
|
|
||||||
|
|
||||||
- [ ] 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
|
|
||||||
|
|
||||||
<!---Ping the related teams. Ask for the engine manager if any hesitation-->
|
|
||||||
<!---@meilisearch/docs-team when there is any API change, e.g. settings addition-->
|
|
100
.github/workflows/check-valid-milestone.yml
vendored
100
.github/workflows/check-valid-milestone.yml
vendored
@ -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!');
|
|
224
.github/workflows/milestone-workflow.yml
vendored
224
.github/workflows/milestone-workflow.yml
vendored
@ -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 <<version>> occurrences
|
|
||||||
sed -i "s/<<version>>/$MILESTONE_VERSION/g" $ISSUE_TEMPLATE
|
|
||||||
|
|
||||||
# Replace all <<milestone_id>> occurrences
|
|
||||||
milestone_id=$(echo $MILESTONE_URL | cut -d '/' -f 7)
|
|
||||||
sed -i "s/<<milestone_id>>/$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 <<version>> occurrences
|
|
||||||
sed -i "s/<<version>>/$MILESTONE_VERSION/g" $ISSUE_TEMPLATE
|
|
||||||
|
|
||||||
# Replace all <<milestone_id>> occurrences
|
|
||||||
milestone_id=$(echo $MILESTONE_URL | cut -d '/' -f 7)
|
|
||||||
sed -i "s/<<milestone_id>>/$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
|
|
Reference in New Issue
Block a user