Skip to content

Commit

Permalink
Merge branch 'main' into router-reorg
Browse files Browse the repository at this point in the history
  • Loading branch information
OlivierHecart committed Jan 29, 2024
2 parents 7af8480 + 0943243 commit 2ddfd45
Show file tree
Hide file tree
Showing 68 changed files with 2,720 additions and 1,058 deletions.
File renamed without changes.
7 changes: 3 additions & 4 deletions .github/ISSUE_TEMPLATE/bug_report.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
name: Report a bug
name: Bug
description: |
Create a bug report to help us improve Zenoh.
title: "[Bug] "
Report a bug.
labels: ["bug"]
body:
- type: textarea
Expand All @@ -19,7 +18,7 @@ body:
attributes:
label: To reproduce
description: "Steps to reproduce the behavior:"
placeholder: |
placeholder: |
1. Start a subscriber "..."
2. Start a publisher "...."
3. See error
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
name: Request a feature
name: New feature
description: |
Suggest a new feature specific to this repository. NOTE: for generic Zenoh ideas use "Ask a question".
Suggest a new feature.
labels: ["new feature"]
body:
- type: markdown
attributes:
Expand Down
29 changes: 29 additions & 0 deletions .github/ISSUE_TEMPLATE/release.yml
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
60 changes: 60 additions & 0 deletions .github/workflows/enforce-linking-issues.yml
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,
});
103 changes: 103 additions & 0 deletions .github/workflows/sync-lockfiles.yml
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 }}
76 changes: 76 additions & 0 deletions .github/workflows/update-release-project.yml
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
Loading

0 comments on commit 2ddfd45

Please sign in to comment.