phylum-ci
Python package for handling CI and other integrations
Science Score: 26.0%
This score indicates how likely this project is to be science-related based on various indicators:
-
○CITATION.cff file
-
✓codemeta.json file
Found codemeta.json file -
✓.zenodo.json file
Found .zenodo.json file -
○DOI references
-
○Academic publication links
-
○Committers with academic emails
-
○Institutional organization owner
-
○JOSS paper metadata
-
○Scientific vocabulary similarity
Low similarity (13.4%) to scientific vocabulary
Keywords
Keywords from Contributors
Repository
Python package for handling CI and other integrations
Basic Info
Statistics
- Stars: 10
- Watchers: 5
- Forks: 1
- Open Issues: 9
- Releases: 87
Topics
Metadata Files
README.md
phylum-ci
Utilities for integrating Phylum into CI pipelines
Installation and usage
Installation
The phylum Python package is pip installable for the environment of your choice:
sh
pip install phylum
It can also be installed in an isolated environment with the excellent pipx tool:
```sh
Globally install the app(s) on your system in an isolated virtual environment for the package
pipx install phylum
Use the apps from the package in an ephemeral environment
pipx run --spec phylum phylum-init
These installation methods require Python 3.10+ to run. For a self contained environment, consider using the Docker image as described below.
Windows binaries are offered as release artifacts for a "standalone" solution that does not require Python or Docker to run. There are two options for this installation method:
phylum-ci.zip- Download the latest archive version and extract it
- Add the extracted directory to
PATHor reference the containedphylum-ci.exebinary directly
phylum-ci.exe- Download the latest executable version and place this binary on
PATHor reference it directly - This is a self-extracting executable that adds a version-specific directory in the local user cache
- Download the latest executable version and place this binary on
An advantage to the self-extracting archive is that it is a single file. A disadvantage is that the file may trigger AV since it uses a packer and is not digitally signed.
Either Windows "installation" method allows access to the same phylum-ci script entry point features.
Usage
The phylum Python package exposes its functionality with a command line interface (CLI).
To view the options available from the CLI, print the help message from one of the scripts provided as entry points:
sh
phylum-init -h
phylum-ci -h
The functionality can also be accessed by calling the module:
sh
python -m phylum.init -h
python -m phylum.ci -h
The functionality is also exposed in the form of a Docker image:
```sh
Get the latest tagged image
docker pull phylumio/phylum-ci
View the help
docker run --rm phylumio/phylum-ci phylum-ci --help
Export a Phylum token (e.g., from phylum auth token)
export PHYLUMAPIKEY=$(phylum auth token)
Run it from a git repo directory containing at least one supported lockfile or manifest
docker run -it --rm -e PHYLUMAPIKEY --mount type=bind,src=$(pwd),dst=/phylum -w /phylum phylumio/phylum-ci ```
The default Docker image contains git and the installed phylum Python package.
It also contains an installed version of the Phylum CLI and all required tools needed for lockfile generation.
An advantage of using the default Docker image is that the complete environment is packaged and made available with
components that are known to work together.
One disadvantage to the default image is it's size. It can take a while to download and may provide more tools than
required for your specific use case. Special slim tags of the phylum-ci image are provided as an alternative.
These tags differ from the default image in that they do not contain the required tools needed for lockfile generation. The slim tags are significantly smaller and will allow integrations relying
on them to complete faster. They are useful for those instances where no manifest files are present and/or only
lockfiles are used.
```sh
Get the "latest" slim tagged image
docker pull phylumio/phylum-ci:slim ```
When using the latest tagged image, the version of the Phylum CLI is the latest available.
There are additional image tag options available to specify a specific release of the phylum-ci project and a specific
version of the Phylum CLI, in the form of <phylum-ci version>-CLIv<Phylum CLI version>.
Each of these also has a -slim variant that does not support lockfile generation. Here are image tag examples:
```sh
Get the most current release of both phylum-ci and the Phylum CLI
docker pull phylumio/phylum-ci:latest
Get the image with phylum-ci version 0.44.1 and Phylum CLI version 6.6.0
docker pull phylumio/phylum-ci:0.44.1-CLIv6.6.0
Get the slim image with phylum-ci version 0.47.0 and Phylum CLI version 6.6.4
docker pull phylumio/phylum-ci:0.47.0-CLIv6.6.4-slim ```
phylum-init Script Entry Point
The phylum-init script can be used to fetch and install the Phylum CLI.
It will attempt to install the latest released version of the CLI but can be specified to fetch a specific version.
It will attempt to automatically determine the correct CLI release, based on the platform where the script is run, but
a specific release target can be specified.
It will accept a Phylum token from an environment variable or specified as an option, but will also function in the case
that no token is provided. This can be because there is already a token set that should continue to be used or because
no token exists and one will need to be manually created or set, after the CLI is installed.
The options for phylum-init, automatically updated to be current for the latest release:
HINT: Click on the image to bring up the SVG file, which should allow for search and copy/paste functionality.
phylum-ci Script Entry Point
The phylum-ci script is for analyzing dependency file (lockfiles and manifests) changes.
The script can be used locally or from within a Continuous Integration (CI) environment.
It will attempt to detect the CI platform based on the environment from which it is run and act accordingly.
The current CI platforms/environments supported are:
|Platform/Environment|Information Link|
|--------------------|---------------------|
|GitHub Actions|Documentation|
|GitLab CI|Documentation|
|Azure Pipelines|Documentation|
|Bitbucket Pipelines|Documentation|
|Jenkins Pipelines|Documentation|
|Git pre-commit Hooks|Documentation|
There is also support for local use. This is the "fall-through" case used when no other environment is detected. This can be useful to analyze dependency files locally, prior to or after submitting a pull/merge request (PR/MR) to a CI system. It can also help in establishing a successful submission prior to submitting a PR/MR to a CI system. Additionally, local use can aid troubleshooting after submitting a PR/MR to a CI system and getting unexpected results.
The options for phylum-ci, automatically updated to be current for the latest release:
HINT: Click on the image to bring up the SVG file, which should allow for search and copy/paste functionality.
Exit Codes
The phylum-init script entry point will return a zero (0) exit code when it completes successfully and a one (1)
otherwise.
The phylum-ci script entry point will return a zero (0) exit code when it completes successfully or one of the
following non-zero codes otherwise:
|Exit Code|Meaning| |---------|-------| |1|Default failure code. An unrecoverable error was encountered.| |2|Phylum analysis is complete and contains a policy violation.| |5|Phylum analysis is incomplete. Only used when enabled by option.| |6|Phylum analysis is incomplete and contains a policy violation.| |10|Dependency file(s) failed filtering and excluded from analysis. See this FAQ for more.| |11|No dependency files were provided or detected.| |12|No dependencies found in any current dependency file.| |20|A manifest is attempted to be parsed but lockfile generation has been disabled.|
Exit codes of 10 or higher represent situations not directly linked to Phylum analysis. These errors are important because they indicate a complete Phylum analysis was not possible, which necessitates further investigation. An option is available to explicitly prevent these errors from setting an exit code.
License
Copyright (C) 2022 Phylum, Inc.
This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License or any later version.
This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
You should have received a copy of the GNU General Public License along with this program.
If not, see https://www.gnu.org/licenses/gpl.html or write to phylum@veracode.com or
dl-phylum-engineering@veracode.com
Contributing
Suggestions and help are welcome. Feel free to open an issue or otherwise contribute. More information is available on the contributing documentation page.
Code of Conduct
Everyone participating in the phylum-ci project, and in particular in the issue tracker and pull requests, is
expected to treat other people with respect and more generally to follow the guidelines articulated in the
Code of Conduct.
Security Disclosures
Found a security issue in this repository? See the security policy for details on coordinated disclosure.
Change log
All notable changes to this project are documented in the CHANGELOG.
The format of the change log is based on Keep a Changelog, and this project adheres to Semantic Versioning. The entries in the changelog are primarily automatically generated through the use of conventional commits and the Python Semantic Release tool. However, some entries may be manually edited, where it helps for clarity and understanding.
Owner
- Name: Phylum
- Login: phylum-dev
- Kind: organization
- Email: phylum@phylum.io
- Location: United States of America
- Website: http://phylum.io
- Twitter: Phylum_IO
- Repositories: 10
- Profile: https://github.com/phylum-dev
GitHub Events
Total
- Create event: 96
- Release event: 10
- Issues event: 8
- Delete event: 77
- Issue comment event: 67
- Push event: 123
- Pull request review comment event: 20
- Pull request event: 155
- Pull request review event: 100
Last Year
- Create event: 96
- Release event: 10
- Issues event: 8
- Delete event: 77
- Issue comment event: 67
- Push event: 123
- Pull request review comment event: 20
- Pull request event: 155
- Pull request review event: 100
Committers
Last synced: 10 months ago
Top Committers
| Name | Commits | |
|---|---|---|
| phylum-bot | 6****t | 224 |
| Charles Coggins | m****e | 205 |
| dependabot[bot] | 4****] | 86 |
| Brad Crawford | 3****3 | 4 |
| Kyle Willmon | k****e@p****o | 2 |
| github-actions | g****s@g****m | 1 |
| Louis Lang | 1****g | 1 |
| Eric Ortega | 2****a | 1 |
| semantic-release | s****e | 1 |
Committer Domains (Top 20 + Academic)
Issues and Pull Requests
Last synced: 6 months ago
All Time
- Total issues: 55
- Total pull requests: 473
- Average time to close issues: 3 months
- Average time to close pull requests: 1 day
- Total issue authors: 6
- Total pull request authors: 8
- Average comments per issue: 0.78
- Average comments per pull request: 0.97
- Merged pull requests: 421
- Bot issues: 0
- Bot pull requests: 136
Past Year
- Issues: 6
- Pull requests: 145
- Average time to close issues: about 1 month
- Average time to close pull requests: about 23 hours
- Issue authors: 2
- Pull request authors: 3
- Average comments per issue: 2.33
- Average comments per pull request: 0.77
- Merged pull requests: 129
- Bot issues: 0
- Bot pull requests: 34
Top Authors
Issue Authors
- maxrake (51)
- furi0us333 (2)
- croe-voxtur (1)
- phylum-bot (1)
- ejortega (1)
- TizERBTC (1)
Pull Request Authors
- phylum-bot (193)
- maxrake (170)
- dependabot[bot] (149)
- furi0us333 (2)
- louislang (1)
- ejortega (1)
- kylewillmon (1)
- cd-work (1)
- marvin-hansen (1)
Top Labels
Issue Labels
Pull Request Labels
Packages
- Total packages: 2
-
Total downloads:
- pypi 240 last-month
-
Total dependent packages: 0
(may contain duplicates) -
Total dependent repositories: 2
(may contain duplicates) - Total versions: 89
- Total maintainers: 1
pypi.org: phylum
Utilities for integrating Phylum into CI pipelines
- Homepage: https://veracode.com/
- Documentation: https://docs.phylum.io/
- License: GPL-3.0-or-later
-
Latest release: 0.58.1
published 11 months ago
Rankings
Maintainers (1)
pypi.org: phylum-ci
Utilities for Phylum integrations
- Homepage: https://phylum.io/
- Documentation: https://docs.phylum.io/
- License: MIT
-
Latest release: 0.0.1
published almost 4 years ago
Rankings
Maintainers (1)
Dependencies
- atomicwrites 1.4.0 develop
- attrs 21.4.0 develop
- bleach 5.0.0 develop
- click 8.1.2 develop
- click-log 0.4.0 develop
- colorama 0.4.4 develop
- distlib 0.3.4 develop
- docutils 0.18.1 develop
- dotty-dict 1.3.0 develop
- filelock 3.6.0 develop
- gitdb 4.0.9 develop
- gitpython 3.1.27 develop
- importlib-resources 5.7.1 develop
- iniconfig 1.1.1 develop
- invoke 1.7.0 develop
- jeepney 0.8.0 develop
- keyring 23.5.0 develop
- pkginfo 1.8.2 develop
- platformdirs 2.5.2 develop
- pluggy 1.0.0 develop
- py 1.11.0 develop
- pygments 2.12.0 develop
- pytest 7.1.1 develop
- pytest-github-actions-annotate-failures 0.1.6 develop
- python-gitlab 3.3.0 develop
- python-semantic-release 7.28.1 develop
- pywin32-ctypes 0.2.0 develop
- readme-renderer 35.0 develop
- requests-toolbelt 0.9.1 develop
- rfc3986 2.0.0 develop
- secretstorage 3.3.2 develop
- semver 2.13.0 develop
- setuptools-scm 6.4.2 develop
- six 1.16.0 develop
- smmap 5.0.0 develop
- toml 0.10.2 develop
- tomli 2.0.1 develop
- tomlkit 0.10.2 develop
- tox 3.25.0 develop
- tox-gh-actions 2.9.1 develop
- tqdm 4.64.0 develop
- twine 3.8.0 develop
- types-requests 2.27.25 develop
- types-urllib3 1.26.14 develop
- virtualenv 20.14.1 develop
- webencodings 0.5.1 develop
- certifi 2021.10.8
- cffi 1.15.0
- charset-normalizer 2.0.12
- cryptography 36.0.2
- idna 3.3
- importlib-metadata 4.11.3
- packaging 21.3
- pycparser 2.21
- pyparsing 3.0.8
- requests 2.27.1
- ruamel.yaml 0.17.21
- ruamel.yaml.clib 0.2.6
- typing-extensions 4.2.0
- urllib3 1.26.9
- zipp 3.8.0
- pytest ^7.1.1 develop
- pytest-github-actions-annotate-failures ^0.1.6 develop
- python-semantic-release ^7.28.1 develop
- tomli ^2.0.1 develop
- tox ^3.24.5 develop
- tox-gh-actions ^2.9.1 develop
- types-requests ^2.27.25 develop
- cryptography ^36.0.2
- importlib-metadata ^4.11.3
- packaging ^21.3
- python ^3.7
- requests ^2.27.1
- ruamel.yaml ^0.17.21
- actions/checkout 3df4ab11eba7bda6032a0b82a6bb43b11571feac composite
- actions/github-script d7906e4ad0b1822421a7e6a35d5ca353c962f410 composite
- actions/setup-python 61a6322f88396a6271a6ee3565807d608ecaddd1 composite
- crazy-max/ghaction-import-gpg 82a020f1f7f605c65dd2449b392a52c3fcfef7ef composite
- actions/checkout 3df4ab11eba7bda6032a0b82a6bb43b11571feac composite
- actions/checkout 3df4ab11eba7bda6032a0b82a6bb43b11571feac composite
- phylum-dev/phylum-analyze-pr-action 53d203dd18c41350a673bcc236aa05337eb6edf3 composite
- actions/checkout 3df4ab11eba7bda6032a0b82a6bb43b11571feac composite
- actions/setup-python 61a6322f88396a6271a6ee3565807d608ecaddd1 composite
- actions/upload-artifact a8a3f3ad30e3422c9c7b888a15615d19a852ae32 composite
- actions/checkout 3df4ab11eba7bda6032a0b82a6bb43b11571feac composite
- actions/setup-python 61a6322f88396a6271a6ee3565807d608ecaddd1 composite
- crazy-max/ghaction-import-gpg 82a020f1f7f605c65dd2449b392a52c3fcfef7ef composite
- actions/checkout 3df4ab11eba7bda6032a0b82a6bb43b11571feac composite
- actions/setup-python 61a6322f88396a6271a6ee3565807d608ecaddd1 composite
- python 3.11-slim-bullseye build