-
Notifications
You must be signed in to change notification settings - Fork 178
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'main' into router-reorg
- Loading branch information
Showing
68 changed files
with
2,720 additions
and
1,058 deletions.
There are no files selected for viewing
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
5 changes: 3 additions & 2 deletions
5
.github/ISSUE_TEMPLATE/feature_request.yml → .github/ISSUE_TEMPLATE/new_feature.yml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
name: Add an issue to the next release | ||
description: | | ||
Add an issue as part of next release. | ||
This will be added to the current release project. | ||
You must be a contributor to use this template. | ||
labels: ["release"] | ||
body: | ||
- type: markdown | ||
attributes: | ||
value: | | ||
**Guidelines for a good issue** | ||
*Is your release item related to a problem?* | ||
A clear and concise description of what the problem is. Ex. I'm always frustrated when [...] | ||
*Describe the solution you'd like* | ||
A clear and concise description of what you want to happen. | ||
*Describe alternatives you've considered* | ||
A clear and concise description of any alternative solutions or features you've considered. | ||
*Additional context* | ||
Add any other context about the release item request here. | ||
- type: textarea | ||
id: item | ||
attributes: | ||
label: "Describe the release item" | ||
validations: | ||
required: true |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,60 @@ | ||
name: Enforce linking issues | ||
|
||
on: | ||
pull_request_target: | ||
types: [opened, edited, labeled] | ||
workflow_call: | ||
|
||
defaults: | ||
run: | ||
shell: bash | ||
|
||
jobs: | ||
main: | ||
name: Enforce referencing a closing issue | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Count closing issue references | ||
id: has-closing-issue | ||
uses: actions/github-script@v7 | ||
with: | ||
result-encoding: string | ||
script: | | ||
const query = `query ($owner: String!, $name: String!, $number: Int!) { | ||
repository(owner: $owner, name: $name) { | ||
pullRequest(number: $number) { | ||
closingIssuesReferences(first: 100) { | ||
totalCount | ||
} | ||
} | ||
} | ||
}`; | ||
const reply = await github.graphql(query, { | ||
owner: context.repo.owner, | ||
name: context.repo.repo, | ||
number: context.payload.pull_request.number | ||
}); | ||
return reply | ||
.repository | ||
.pullRequest | ||
.closingIssuesReferences | ||
.totalCount > 0; | ||
- if: ${{ steps.has-closing-issue.outputs.result != 'true' }} | ||
name: Suggest that the contributor link an issue | ||
uses: actions/github-script@v7 | ||
with: | ||
github-token: ${{ secrets.BOT_TOKEN_WORKFLOW }} | ||
script: | | ||
const login = "${{ github.event.pull_request.user.login }}"; | ||
const syntaxUrl = "https://docs.github.com/en/issues/tracking-your-work-with-issues/linking-a-pull-request-to-an-issue"; | ||
const message = `@{login} If this pull request contains a bugfix or a new feature, then please consider using \`Closes #ISSUE-NUMBER\` [syntax](${syntaxUrl}) to link it to an issue.` | ||
github.rest.issues.createComment({ | ||
owner: context.repo.owner, | ||
repo: context.repo.repo, | ||
issue_number: context.payload.pull_request.number, | ||
body: message, | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,103 @@ | ||
name: Sync Cargo lockfile with Zenoh's dependants | ||
|
||
on: | ||
schedule: | ||
- cron: "0 0 * * *" # At the end of every day | ||
workflow_dispatch: | ||
|
||
defaults: | ||
run: | ||
shell: bash | ||
|
||
jobs: | ||
fetch: | ||
name: Fetch Zenoh's lockfile | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout Zenoh | ||
uses: actions/checkout@v4 | ||
with: | ||
repository: eclipse-zenoh/zenoh | ||
|
||
- name: Upload lockfile | ||
uses: actions/upload-artifact@v3 | ||
with: | ||
name: Cargo.lock | ||
path: Cargo.lock | ||
|
||
sync: | ||
name: Sync Cargo lockfile with ${{ matrix.dependant }} | ||
needs: fetch | ||
runs-on: ubuntu-latest | ||
strategy: | ||
matrix: | ||
dependant: | ||
- zenoh-c | ||
- zenoh-python | ||
- zenoh-java | ||
- zenoh-kotlin | ||
- zenoh-plugin-dds | ||
- zenoh-plugin-mqtt | ||
- zenoh-plugin-ros1 | ||
- zenoh-plugin-ros2dds | ||
- zenoh-plugin-webserver | ||
- zenoh-backend-filesystem | ||
- zenoh-backend-influxdb | ||
- zenoh-backend-rocksdb | ||
- zenoh-backend-s3 | ||
steps: | ||
- name: Checkout ${{ matrix.dependant }} | ||
uses: actions/checkout@v4 | ||
with: | ||
repository: eclipse-zenoh/${{ matrix.dependant }} | ||
submodules: true | ||
token: ${{ secrets.BOT_TOKEN_WORKFLOW }} | ||
|
||
- name: Install Rust toolchain | ||
# NOTE: Showing the active Rust toolchain (defined by the rust-toolchain.toml file) | ||
# will have the side effect of installing it; if it's not installed already. | ||
run: rustup show | ||
|
||
# NOTE: Not all Zenoh dependants have their Cargo manifest and lockfile | ||
# at the repository's toplevel. The only exception being zenoh-kotlin and | ||
# zenoh-java. Thus the need for this ugly workaround. | ||
- name: Compute crate path of ${{ matrix.dependant }} | ||
id: crate-path | ||
run: | | ||
if [[ "${{ matrix.dependant }}" =~ zenoh-(java|kotlin) ]]; then | ||
echo "value=zenoh-jni" >> $GITHUB_OUTPUT | ||
else | ||
echo "value=." >> $GITHUB_OUTPUT | ||
fi | ||
- name: Override ${{ matrix.dependant }} lockfile with Zenoh's | ||
uses: actions/download-artifact@v3 | ||
with: | ||
name: Cargo.lock | ||
path: ${{ steps.crate-path.outputs.value }} | ||
|
||
- name: Rectify lockfile | ||
# NOTE: Checking the package for errors will rectify the Cargo.lock while preserving | ||
# the dependency versions fetched from source. | ||
run: cargo check --manifest-path ${{ steps.crate-path.outputs.value }}/Cargo.toml | ||
|
||
- name: Create/Update a pull request if the lockfile changed | ||
id: cpr | ||
# NOTE: If there is a pending PR, this action will simply update it with a forced push. | ||
uses: peter-evans/create-pull-request@v5 | ||
with: | ||
title: Sync lockfile with Zenoh's | ||
body: Automated synchronization of the Cargo lockfile with Zenoh. This is done to ensure plugin ABI compatibility. | ||
commit-message: "chore: Sync Cargo lockfile with Zenoh's" | ||
committer: eclipse-zenoh-bot <[email protected]> | ||
author: eclipse-zenoh-bot <[email protected]> | ||
branch: eclipse-zenoh-bot/sync-lockfile | ||
delete-branch: true | ||
labels: dependencies | ||
token: ${{ secrets.BOT_TOKEN_WORKFLOW }} | ||
|
||
- name: Enable auto merge for the pull request | ||
if: steps.cpr.outputs.pull-request-operation == 'created' | ||
run: gh pr merge -R "eclipse-zenoh/${{ matrix.dependant }}" --merge --auto "${{ steps.cpr.outputs.pull-request-number }}" | ||
env: | ||
GH_TOKEN: ${{ secrets.BOT_TOKEN_WORKFLOW }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,76 @@ | ||
name: Update release project | ||
|
||
on: | ||
issues: | ||
types: [opened, edited, labeled] | ||
workflow_call: | ||
|
||
defaults: | ||
run: | ||
shell: bash | ||
|
||
jobs: | ||
main: | ||
name: Add relevant issue to the release project | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Get the latest release project | ||
id: get-project-url | ||
uses: actions/github-script@v7 | ||
with: | ||
github-token: ${{ secrets.BOT_TOKEN_WORKFLOW }} | ||
result-encoding: string | ||
script: | | ||
const query = `query ($login: String!) { | ||
organization(login: $login) { | ||
projectsV2(first: 100, orderBy: {direction: DESC, field: NUMBER}) { | ||
nodes { | ||
title | ||
url | ||
} | ||
} | ||
} | ||
}`; | ||
const projects = await github.graphql(query, { | ||
login: context.repo.owner | ||
}); | ||
const result = projects | ||
.organization | ||
.projectsV2 | ||
.nodes | ||
.find(p => /zenoh [\w\.\-\+]+ release/i.test(p.title)) | ||
.url; | ||
core.info(`Using release project ${result}`) | ||
return result; | ||
- name: Is the issue author a contributor? | ||
id: author-is-contributor | ||
uses: actions/github-script@v7 | ||
with: | ||
result-encoding: string | ||
script: | | ||
const contributors = await github.rest.repos.listContributors({ | ||
owner: context.repo.owner, | ||
repo: context.repo.repo, | ||
}); | ||
const login = "${{ github.event.issue.user.login }}"; | ||
const result = contributors | ||
.data | ||
.map(c => c.login) | ||
.includes(login); | ||
core.info(`Is the issue author ${login} a contributor? ${result}`); | ||
return result; | ||
- if: ${{ steps.author-is-contributor.outputs.result == 'true' }} | ||
name: Add issue to the release project if it has a release label | ||
uses: actions/[email protected] | ||
with: | ||
github-token: ${{ secrets.BOT_TOKEN_WORKFLOW }} | ||
project-url: ${{ steps.get-project-url.outputs.result }} | ||
labeled: release |
Oops, something went wrong.