Skip to content
Merged
Show file tree
Hide file tree
Changes from 4 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions .github/CODEOWNERS
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
# Default code owner for nipanel-python
mikeprosserni
47 changes: 47 additions & 0 deletions .github/ISSUE_TEMPLATE/bug_report.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
---
name: Bug report
about: Create a report to help us improve
title: ''
labels: 'bug,triage'
---

<!---
Thanks for filing an issue! Before you submit, please read the following:

Search open/closed issues before submitting. Someone may have reported the same issue before.
-->

# Bug Report

<!--- Provide a general summary of the issue here -->

## Repro or Code Sample

<!-- Please provide steps to reproduce the issue and/or a code repository, gist, code snippet or sample files -->

## Expected Behavior

<!--- Tell us what should happen -->

## Current Behavior

<!--- Tell us what happens instead of the expected behavior -->
<!--- If you are seeing an error, please include the full error message and stack trace -->
<!--- If applicable, provide screenshots -->

## Possible Solution

<!--- Not obligatory, but suggest a fix/reason for the bug -->
<!--- Please let us know if you'd be willing to contribute the fix; we'd be happy to work with you -->

## Context

<!--- How has this issue affected you? What are you trying to accomplish? -->
<!--- Providing context helps us come up with a solution that is most useful in the real world -->

## Your Environment

<!--- Include as many relevant details as possible about the environment you experienced the bug in -->

* `nipanel` version
* Python version
25 changes: 25 additions & 0 deletions .github/ISSUE_TEMPLATE/feature_request.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
---
name: Feature request
about: Suggest an idea for this project
title: ''
labels: 'enhancement,triage'
---

<!---
Thanks for filing an issue! Before you submit, please read the following:

Search open/closed issues before submitting. Someone may have requested the same feature before.
-->

## Problem to Solve

<!--- Provide a clear and concise description of why this feature is wanted or what problem it solves. -->

## Proposed Solution

<!--- Provide a clear and concise description of the feature you're proposing. -->

<!--- The implementing team may build a list of tasks/sub-issues here:
## Tasks
- [ ] This is a subtask of the feature. (It can be converted to an issue.)
-->
7 changes: 7 additions & 0 deletions .github/ISSUE_TEMPLATE/tech_debt.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
---
name: Tech debt
about: (DEV TEAM ONLY) Non-user-visible improvement to code or development process
title: ''
labels: 'tech debt,triage'
---
## Tech Debt
10 changes: 10 additions & 0 deletions .github/ISSUE_TEMPLATE/user_story.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
---
name: User story
about: (DEV TEAM ONLY) A small chunk of work to be done
title: '(Fully descriptive title)'
labels: 'user story,triage'
---

<!-- Ensure the title can be understood without the parent item's context, e.g. "nimble-button Angular wrapper" rather than just "Angular wrapper" -->

## User Story
11 changes: 11 additions & 0 deletions .github/PULL_REQUEST_TEMPLATE.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
### What does this Pull Request accomplish?

TODO: Include high-level description of the changes in this pull request.

### Why should this Pull Request be merged?

TODO: Justify why this contribution should be part of the project.

### What testing has been done?

TODO: Detail what testing has been done to ensure this submission meets requirements.
23 changes: 23 additions & 0 deletions .github/workflows/CI.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
name: CI

on:
push:
branches:
- main
- 'releases/**'
workflow_call:
workflow_dispatch:

jobs:
check_nipanel:
name: Check
uses: ./.github/workflows/check_nipanel.yml
run_unit_tests:
name: Run unit tests
uses: ./.github/workflows/run_unit_tests.yml
needs: [check_nipanel]
report_test_results:
name: Report test results
uses: ./.github/workflows/report_test_results.yml
needs: [run_unit_tests]
if: always()
18 changes: 18 additions & 0 deletions .github/workflows/PR.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
name: PR

on:
pull_request:
branches:
- main
- 'releases/**'
workflow_call:
workflow_dispatch:

concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
cancel-in-progress: true

jobs:
run_ci:
name: Run CI
uses: ./.github/workflows/CI.yml
50 changes: 50 additions & 0 deletions .github/workflows/check_nipanel.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
name: Check nipanel

on:
workflow_call:
workflow_dispatch:

env:
POETRY_VERSION: 1.8.2
PYTHON_VERSION: 3.11.9

jobs:
check_nipanel:
name: Check nipanel
runs-on: ubuntu-latest
steps:
- name: Check out repo
uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v5
id: setup-python
with:
python-version: ${{ env.PYTHON_VERSION }}
- name: Set up Poetry
uses: Gr1N/setup-poetry@v9
with:
poetry-version: ${{ env.POETRY_VERSION }}
- name: Check for lock changes
run: poetry check --lock
- name: Restore cached virtualenv
uses: actions/cache/restore@v4
id: restore-nipanel
with:
path: .venv
key: nipanel-${{ runner.os }}-py${{ steps.setup-python.outputs.python-version }}-${{ hashFiles('poetry.lock') }}
- name: Install nipanel
run: poetry install -v
- name: Save cached virtualenv
uses: actions/cache/save@v4
if: steps.restore-nipanel.outputs.cache-hit != 'true'
with:
path: .venv
key: ${{ steps.restore-nipanel.outputs.cache-primary-key }}
- name: Lint
run: poetry run ni-python-styleguide lint ./src/nipanel ./tests ./examples
- name: Mypy static analysis (Linux)
run: poetry run mypy
- name: Mypy static analysis (Windows)
run: poetry run mypy --platform win32
- name: Bandit security checks
run: poetry run bandit -c pyproject.toml -r src/nipanel
31 changes: 31 additions & 0 deletions .github/workflows/report_test_results.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
name: Report test results

on:
workflow_call:
workflow_dispatch:

permissions:
contents: read
checks: write
pull-requests: write

jobs:
report_test_results:
name: Report test results
runs-on: ubuntu-latest
steps:
- name: Check out repo
uses: actions/checkout@v4
- name: Download test results
uses: actions/download-artifact@v4
with:
path: test_results
pattern: test_results_*
merge-multiple: true
- name: List downloaded files
run: ls -lR
- name: Publish test results
uses: EnricoMi/publish-unit-test-result-action@v2
with:
files: "test_results/**/*.xml"
if: always()
54 changes: 54 additions & 0 deletions .github/workflows/run_unit_tests.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
name: Run unit tests

on:
workflow_call:
workflow_dispatch:

env:
POETRY_VERSION: 1.8.2

jobs:
run_unit_tests:
name: Run unit tests
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [windows-latest, ubuntu-latest]
python-version: [3.9, '3.10', 3.11, 3.12, 3.13]
# Fail-fast skews the pass/fail ratio and seems to make pytest produce
# incomplete JUnit XML results.
fail-fast: false
steps:
- name: Check out repo
uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v5
id: setup-python
with:
python-version: ${{ matrix.python-version }}
- name: Set up Poetry
uses: Gr1N/setup-poetry@v9
with:
poetry-version: ${{ env.POETRY_VERSION }}
- name: Restore cached virtualenv
uses: actions/cache/restore@v4
id: restore-nipanel
with:
path: .venv
key: nipanel-${{ runner.os }}-py${{ steps.setup-python.outputs.python-version }}-${{ hashFiles('poetry.lock') }}
- name: Install nipanel
run: poetry install -v
- name: Save cached virtualenv
uses: actions/cache/save@v4
if: steps.restore-nipanel.outputs.cache-hit != 'true'
with:
path: .venv
key: ${{ steps.restore-nipanel.outputs.cache-primary-key }}
- name: Run unit tests and code coverage
run: poetry run pytest ./tests/unit -v --cov=nipanel --junitxml=test_results/nipanel-${{ matrix.os }}-py${{ matrix.python-version }}.xml
- name: Upload test results
uses: actions/upload-artifact@v4
with:
name: test_results_unit_${{ matrix.os }}_py${{ matrix.python-version }}
path: ./test_results/*.xml
if: always()
38 changes: 38 additions & 0 deletions .github/workflows/sync_github_issues_to_azdo.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
name: Sync issue to Azure DevOps work item

on:
issues:
# Omit "labeled" and "unlabeled" to work around https://github.com/danhellem/github-actions-issue-to-work-item/issues/70
types:
[opened, edited, deleted, closed, reopened, assigned]
issue_comment:
types: [created, edited, deleted]

jobs:
alert:
if: ${{ !github.event.issue.pull_request && github.event.issue.title != 'Dependency Dashboard' }}
runs-on: ubuntu-latest
steps:
- name: Choose work item type
id: choose_work_item_type
run: |
if [ "${{ contains(github.event.issue.labels.*.name, 'enhancement') || contains(github.event.issue.labels.*.name, 'user story') }}" == "true" ]; then
echo "work_item_type=User Story" >> $GITHUB_OUTPUT
elif [ "${{ contains(github.event.issue.labels.*.name, 'tech debt') }}" == "true" ]; then
echo "work_item_type=Technical Debt" >> $GITHUB_OUTPUT
else
echo "work_item_type=Bug" >> $GITHUB_OUTPUT
fi
- uses: danhellem/[email protected]
env:
ado_token: "${{ secrets.AZDO_WORK_ITEM_TOKEN }}"
github_token: "${{ secrets.GH_REPO_TOKEN }}"
ado_organization: "ni"
ado_project: "DevCentral"
ado_area_path: "DevCentral\\Product RnD\\Platform HW and SW\\SW New Invest and Tech\\ETW\\Python CodeGen"
ado_wit: "${{ steps.choose_work_item_type.outputs.work_item_type }}"
ado_new_state: "New"
ado_active_state: "Active"
ado_close_state: "Closed"
ado_bypassrules: true
log_level: 100
62 changes: 62 additions & 0 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
# Contributing to nipanel-python

Contributions to nipanel-python are welcome from all!

nipanel-python is managed via [git](https://git-scm.com), with the canonical upstream
repository hosted on [GitHub](https://github.com/ni/<reponame>/).

nipanel-python follows a pull-request model for development. If you wish to
contribute, you will need to create a GitHub account, fork this project, push a
branch with your changes to your project, and then submit a pull request.

Please remember to sign off your commits (e.g., by using `git commit -s` if you
are using the command line client). This amends your git commit message with a line
of the form `Signed-off-by: Name Lastname <[email protected]>`. Please
include all authors of any given commit into the commit message with a
`Signed-off-by` line. This indicates that you have read and signed the Developer
Certificate of Origin (see below) and are able to legally submit your code to
this repository.

See [GitHub's official documentation](https://help.github.com/articles/using-pull-requests/) for more details.

# Getting Started

This is the command to generate the files in /src/ni/pythonpanel/v1/:
`poetry run python -m grpc_tools.protoc --proto_path=protos --python_out=src/ --grpc_python_out=src/ ni/pythonpanel/v1/python_panel_service.proto`

# Testing

- TODO: include testing steps here.

# Developer Certificate of Origin (DCO)

Developer's Certificate of Origin 1.1

By making a contribution to this project, I certify that:

(a) The contribution was created in whole or in part by me and I
have the right to submit it under the open source license
indicated in the file; or

(b) The contribution is based upon previous work that, to the best
of my knowledge, is covered under an appropriate open source
license and I have the right under that license to submit that
work with modifications, whether created in whole or in part
by me, under the same open source license (unless I am
permitted to submit under a different license), as indicated
in the file; or

(c) The contribution was provided directly to me by some other
person who certified (a), (b) or (c) and I have not modified
it.

(d) I understand and agree that this project and the contribution
are public and that a record of the contribution (including all
personal information I submit with it, including my sign-off) is
maintained indefinitely and may be redistributed consistent with
this project or the open source license(s) involved.

(taken from [developercertificate.org](https://developercertificate.org/))

See [LICENSE](https://github.com/ni/<reponame>/blob/main/LICENSE)
for details about how \<reponame\> is licensed.
Loading
Loading