Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Trigger actions on pull_requests #408

Merged
merged 2 commits into from
May 2, 2024
Merged
Show file tree
Hide file tree
Changes from all 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
20 changes: 20 additions & 0 deletions .github/workflows/pre-commit.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
name: pre-commit

on:
push:
branches:
- main
- develop
pull_request:

jobs:
main:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: "3.x"
- uses: pre-commit/[email protected]
- uses: pre-commit-ci/[email protected]
if: always()
127 changes: 127 additions & 0 deletions .github/workflows/publish-to-pypi.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,127 @@
name: Publish Python 🐍 distribution 📦 to PyPI and TestPyPI

on: push

jobs:
build:
name: Build distribution 📦
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
fetch-tags: true
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: "3.x"
- name: Install pypa/build
run: >-
python3 -m
pip install
build
--user
- name: Install dunamai
run: >-
python3 -m
pip install
dunamai
--user
- name: Build a binary wheel and a source tarball
run: DYNAMIC_VERSION=$(dunamai from git --no-metadata) python3 -m build
- name: Store the distribution packages
uses: actions/upload-artifact@v4
with:
name: python-package-distributions
path: dist/

publish-to-pypi:
name: >-
Publish Python 🐍 distribution 📦 to PyPI
if: startsWith(github.ref, 'refs/tags/') # only publish to PyPI on tag pushes
needs:
- build
runs-on: ubuntu-latest
environment:
name: pypi
url: https://pypi.org/p/ztpserver
permissions:
id-token: write # IMPORTANT: mandatory for trusted publishing

steps:
- name: Download all the dists
uses: actions/download-artifact@v4
with:
name: python-package-distributions
path: dist/
- name: Publish distribution 📦 to PyPI
uses: pypa/gh-action-pypi-publish@release/v1

github-release:
name: >-
Sign the Python 🐍 distribution 📦 with Sigstore
and upload them to GitHub Release
needs:
- publish-to-pypi
runs-on: ubuntu-latest

permissions:
contents: write # IMPORTANT: mandatory for making GitHub Releases
id-token: write # IMPORTANT: mandatory for sigstore

steps:
- name: Download all the dists
uses: actions/download-artifact@v4
with:
name: python-package-distributions
path: dist/
- name: Sign the dists with Sigstore
uses: sigstore/[email protected]
with:
inputs: >-
./dist/*.tar.gz
./dist/*.whl
- name: Create GitHub Release
env:
GITHUB_TOKEN: ${{ github.token }}
run: >-
gh release create
'${{ github.ref_name }}'
--repo '${{ github.repository }}'
--notes ""
- name: Upload artifact signatures to GitHub Release
env:
GITHUB_TOKEN: ${{ github.token }}
# Upload to GitHub Release using the `gh` CLI.
# `dist/` contains the built packages, and the
# sigstore-produced signatures and certificates.
run: >-
gh release upload
'${{ github.ref_name }}' dist/**
--repo '${{ github.repository }}'

publish-to-testpypi:
name: Publish Python 🐍 distribution 📦 to TestPyPI
if: ${{ github.ref == 'refs/heads/develop' || startsWith(github.ref, 'refs/tags/') }}
needs:
- build
runs-on: ubuntu-latest

environment:
name: testpypi
url: https://test.pypi.org/p/ztpserver

permissions:
id-token: write # IMPORTANT: mandatory for trusted publishing

steps:
- name: Download all the dists
uses: actions/download-artifact@v4
with:
name: python-package-distributions
path: dist/
- name: Publish distribution 📦 to TestPyPI
uses: pypa/gh-action-pypi-publish@release/v1
with:
repository-url: https://test.pypi.org/legacy/
11 changes: 8 additions & 3 deletions .github/workflows/pylint.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,11 @@
name: Pylint

on: [push]
on:
push:
branches:
- main
- develop
pull_request:

jobs:
build:
Expand All @@ -9,9 +14,9 @@ jobs:
matrix:
python-version: ["3.7", "3.8", "3.9"]
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v3
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
- name: Install dependencies
Expand Down
9 changes: 7 additions & 2 deletions .github/workflows/unittest-node-py2.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,11 @@
name: Unittest Node py2

on: [push]
on:
push:
branches:
- main
- develop
pull_request:

jobs:
build:
Expand All @@ -12,7 +17,7 @@ jobs:
env:
USER: root
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- name: Install dependencies
run: |
python -m pip install --upgrade pip
Expand Down
11 changes: 8 additions & 3 deletions .github/workflows/unittest-node.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,11 @@
name: Unittest Node

on: [push]
on:
push:
branches:
- main
- develop
pull_request:

jobs:
build:
Expand All @@ -9,9 +14,9 @@ jobs:
matrix:
python-version: ["3.7", "3.8", "3.9"]
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v3
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
- name: Install dependencies
Expand Down
11 changes: 8 additions & 3 deletions .github/workflows/unittest-server.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,11 @@
name: Unittest server

on: [push]
on:
push:
branches:
- main
- develop
pull_request:

jobs:
build:
Expand All @@ -9,9 +14,9 @@ jobs:
matrix:
python-version: ["3.6", "3.7", "3.8", "3.9", "3.10"]
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v3
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
- name: Install dependencies
Expand Down
6 changes: 3 additions & 3 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -1,17 +1,17 @@
repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.4.0
rev: v4.5.0
hooks:
- id: check-yaml
- id: end-of-file-fixer
- id: trailing-whitespace
- repo: https://github.com/psf/black
rev: 23.3.0
rev: 24.4.2
hooks:
- id: black
args: ["-l", "100"]
- repo: https://github.com/pycqa/isort
rev: 5.12.0
rev: 5.13.2
hooks:
- id: isort
name: isort (python)
Expand Down
1 change: 0 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,3 @@
## 1.1.0

See http://ztpserver.readthedocs.org/en/v1.1.0/ReleaseNotes1.1.html

6 changes: 3 additions & 3 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,9 @@ Arista EOS+ ZTPServer provides a community based implementation of a bootstrap s

Contributing Code
=================
Arista EOS+ ZTPServer provides all of its source available to anyone on Github at github.com/arista-eosplus/ztpserver. The project is freely available to anyone to fork and use in their own implementations. The Arista EOS+ community gladly accepts pull requests that add new features, enhance existing features or fix bugs.
Arista EOS+ ZTPServer provides all of its source available to anyone on Github at github.com/arista-eosplus/ztpserver. The project is freely available to anyone to fork and use in their own implementations. The Arista EOS+ community gladly accepts pull requests that add new features, enhance existing features or fix bugs.

All contributed code should be done using pull requests. Once a pull request is initiated, a member of the Arista EOS+ community will review the code and either accept it as is or provide feedback on things to change.
All contributed code should be done using pull requests. Once a pull request is initiated, a member of the Arista EOS+ community will review the code and either accept it as is or provide feedback on things to change.

As a procedural note, all pull requests that add new features and/or enhance the operation of ZTPServer are expected to have corresponding test cases with them. Pull requests will be not accepted without them.

Expand All @@ -16,7 +16,7 @@ Another available way to contribute to this project is to provide requests for f

Bugs
====
If you happen to find a bug with ZTPServer, please open an issue and flag it as a bug. In the issue description please provide details about what you were trying to do, any errors and/or tracebacks and any other information necessary to replicate the bug.
If you happen to find a bug with ZTPServer, please open an issue and flag it as a bug. In the issue description please provide details about what you were trying to do, any errors and/or tracebacks and any other information necessary to replicate the bug.

Contact
=======
Expand Down
2 changes: 1 addition & 1 deletion INSTALL.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,4 +15,4 @@ $ sudo easy_install PyYaml
$ sudo make install

$ ztps
``````
``````
4 changes: 2 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -96,10 +96,10 @@ install:
$(PYTHON) setup.py install

sdist: clean ztpserver.spec
$(PYTHON) setup.py sdist
DYNAMIC_VERSION=$$(dunamai from git --no-metadata) $(PYTHON) setup.py sdist

sdist-dev: clean ztpserver.spec
DEV_VERSION_HASH=$$(git rev-parse --short HEAD) $(PYTHON) setup.py sdist
DYNAMIC_VERSION=$$(dunamai from git) $(PYTHON) setup.py sdist

docker_dev: sdist
@docker build -t ${IMG} .
Expand Down
2 changes: 1 addition & 1 deletion VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
2.0.1.dev0
0.0.0 #uses dynamic version with: dunamai from git --no-metadata
1 change: 0 additions & 1 deletion conf/bootstrap.conf
Original file line number Diff line number Diff line change
Expand Up @@ -15,4 +15,3 @@
# ...
#
# See documentation for the detailed list of possible values.

1 change: 0 additions & 1 deletion conf/neighbordb
Original file line number Diff line number Diff line change
Expand Up @@ -22,4 +22,3 @@
# ...
#
# See documentation for the detailed list of possible values.

4 changes: 2 additions & 2 deletions conf/ztpserver.conf
Original file line number Diff line number Diff line change
Expand Up @@ -23,10 +23,10 @@ disable_topology_validation = False


[server]
# Note: this section only applies to using the standalone server. If
# Note: this section only applies to using the standalone server. If
# running under a WSGI server, these values are ignored

# Interface to which the server will bind to (0:0:0:0 will bind to
# Interface to which the server will bind to (0:0:0:0 will bind to
# all available IPv4 addresses on the local machine)
interface = 0.0.0.0

Expand Down
2 changes: 1 addition & 1 deletion conf/ztpserver.wsgi
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ import sys

from ztpserver.app import start_wsgiapp

sys.stdout.write('Starting ZTPServer...')
sys.stdout.write("Starting ZTPServer...")

application = start_wsgiapp()
# To enable debug output, use:
Expand Down
1 change: 0 additions & 1 deletion docs/CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -56,4 +56,3 @@ Building / Publishing Docs locally
* `make` \(default make target is now `make html`\)
* Open file://_build/html/index.html in your browser to view.
* Publish by copying `docs/_build/html/*` to the `gh-pages` branch

1 change: 0 additions & 1 deletion docs/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,4 +19,3 @@ Documenting REST APIs
---------------------

REST APIs are documented via the [httpdomain](https://pythonhosted.org/sphinxcontrib-httpdomain/) plugin for sphinx.

7 changes: 3 additions & 4 deletions docs/ReleaseNotes1.1.rst
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ Enhancements
* V1.1.0 docs (`181 <https://github.com/arista-eosplus/ztpserver/pull/181>`_)
Documentation has been completely restructured and is now hosted at http://ztpserver.readthedocs.org/.
* refresh_ztps - util script to refresh ZTP Server installation (`177 <https://github.com/arista-eosplus/ztpserver/issues/177>`_)
/utils/refresh_ztps can be used in order to automatically refresh the installation of ZTP Server to the latest code on GitHub. This can be useful in order to pull bug fixes or run the latest version of various development branches.
/utils/refresh_ztps can be used in order to automatically refresh the installation of ZTP Server to the latest code on GitHub. This can be useful in order to pull bug fixes or run the latest version of various development branches.
* Et49 does not match Ethernet49 in neighbordb/pattern files (`172 <https://github.com/arista-eosplus/ztpserver/issues/172>`_)
The local interface in an interface pattern does not have to use the long interface name. For example, all of the following will be treated similarly: Et1, e1, et1, eth1, Eth1, ethernet1, Ethernet1.

Expand Down Expand Up @@ -100,8 +100,8 @@ Enhancements
“domain”*: <DOMAIN>,
“password”*: <PASSWORD>,
“nickname”: <NICKNAME>, // REMOVED
“rooms”*: [ <ROOM>, … ]
“msg_type”: [ “info” | “debug” ] // Optional, default “debug”
“rooms”*: [ <ROOM>, … ]
“msg_type”: [ “info” | “debug” ] // Optional, default “debug”

}
}
Expand Down Expand Up @@ -224,4 +224,3 @@ Resolved issues
.. comment
* fix issue with Pattern creation from neighbordb (`44 <https://github.com/arista-eosplus/ztpserver/issues/44>`_)
.. comment

3 changes: 1 addition & 2 deletions docs/ReleaseNotes1.2.rst
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ Enhancements
s7056.lab.local - - [03/Nov/2014 21:05:33] "POST /nodes HTTP/1.1" 400 0

* Deal more gracefully with DNS/connectivity errors while trying to access remote syslog servers (`215 <https://github.com/arista-eosplus/ztpserver/issues/215>`_)
Logging errors (e.g. bogus destination) will not be automatically logged by the bootstrap script. In order to debug logging issues, simply uncomment the following lines in the bootstrap script:
Logging errors (e.g. bogus destination) will not be automatically logged by the bootstrap script. In order to debug logging issues, simply uncomment the following lines in the bootstrap script:
::

#---------------------------------SYSLOG----------------------
Expand Down Expand Up @@ -179,4 +179,3 @@ Fixed

* ZTPS server fails to write .node because lack of permissions (`126 <https://github.com/arista-eosplus/ztpserver/issues/126>`_)
.. comment

Loading