t5_grp


Namet5_grp JSON
Version 0.1.1 PyPI version JSON
download
home_pageNone
SummaryA tool to generate and visualize pipeline diagrams
upload_time2024-11-26 22:42:27
maintainerNone
docs_urlNone
authorYoyo
requires_python<4.0,>=3.12
licenseMIT
keywords
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            # t5_grp

This project provides a tool for generating visual representations of CI/CD pipelines using data defined in YAML files. The tool leverages Jinja2 for templating and creates an HTML output that visually represents the stages and jobs within a pipeline, including their dependencies and artifacts.


## Table of Contents
- [Features]
- [Development Setup]
- - [Prerequisites]
- - [Build Instructions]
- [User Manual]
- [Pull Request Process]
- - [Creating a PR]
- - [Rules for PRs]
- [CI/CD Workflows]
- [License]

## Features
- YAML Pipeline Configuration
    - Support for multiple stages and jobs
    - Job dependencies management
    - Artifact tracking
    - Allow failure flags
- Visual Pipeline Representation
    - Interactive HTML output
    - Dependency arrows visualization
    - Stage-based layout
    - Artifact tracking across stages

## Configuration Example
```bash
pipeline:
- name: Example Pipeline
- stages:
  - build
  - test
- jobs:
  - name: compile
  - stage: build
  - script:
   - echo "Building..."
  - artifacts:
   - paths:
    - dist/
```

## Output Example
```bash
The tool generates an HTML visualization that shows:
- Pipeline stages in sequential order
- Jobs within each stage
- Dependencies between jobs (shown as arrows)
- Artifacts produced by each job
```

## Development Setup

### Prerequisites

To use this project, you need:

- Python 3.12 or higher
- Required Python packages:
  - - Jinja2
  - - PyYAML
- Poetry (for dependency management)

### Build Instructions

Clone the repository:
```bash
git clone https://github.com/CS6510-SEA-F24/t5-project.git
```
Build the Project:
Using Nox for Automated Builds, Tests, and Linting, file in `noxfile.py`:

We use nox to run automated sessions like testing, linting, and building the project.
Nox allows us to define a "do-all" type script to ensure everything runs in one command.

To run all sessions:

Install the dependencies using Poetry:

```bash
poetry install
```

Run application with Poetry:
```bash
poetry run cicd file_path
# e.g. poetry run cicd /Users/yoyowu/NEU/t5_grp/src/tests/test_files/valid.yaml
```

Running Tests To run all unit tests:
```bash
poetry run pytest
```

To run tests with coverage reports:
```bash
poetry run pytest --cov=src/ --cov-report=term-missing --cov-fail-under=60
```

Lint Code (Flake8): Check code style against PEP8 guidelines:
```bash
poetry run flake8 src
```

Auto-format Code(Black): Automatically format the code in src/ and tests/ to follow PEP8 guidelines:
```bash
poetry run black src
```

Run all checks (using nox)
```bash
poetry run nox -s all
```

### Installation
```bash
pip install t5_grp
```
### Usage

Basic usage:
```bash
cicd path/to/pipeline.yaml
```
With options:
```bash
cicd path/to/pipeline.yaml -o custom_output.html -t dark --stage-gap 80
```

## Pull Request Process

### Creating a PR

#### Always use feature branch to make change:

```bash
git checkout -b <branch_name> # create a new branch with <branch_name>
```

> Direct push to the `main` branch is strictly forbidden as this is the Production branch. All change
> should be merged with an approved PR.

#### Ensure your code is up-to-date with the `main` branch:

```bash
git config pull.rebase true # always use rebase to reconcile divergent branches
git pull
```

> Regularly pull from the `main` branch avoids conflicts pilling up.
> Please make sure you pull again before creating a PR.
#### Follow the PR Template:

- Your PR description should address any relevant context to help the reviewer to understand the
  PR. If this is related to an issue, reference the issue in the description.
- Make sure to use the checklist, and give explanations to any unchecked ones.

#### Check PR details:

- Make sure the origin and destination of the PR is correct, as well as everything in the Commits
  and Files changed tabs before clicking "Create Pull Request".

### Rules for PRs

#### Testing:

- Ensure all new code is properly tested.
#### Commit Guidelines:

- Use [meaningful commit messages](https://www.freecodecamp.org/news/how-to-write-better-git-commit-messages/).
  Squash commits if necessary to clean up the history.

#### Merging:

- When merging PRs, always use **SQUASH AND MERGE** to combine all changes into a single commit.

## CI/CD Workflows

This project uses **GitHub Actions** for CI/CD automation. The configured CI/CD workflows are:

- **PR Size Check**:

    - This workflow is triggered when a new PR is created, or when a new commit is pushed to an existing PR.
    - It fails if the size of PR is greater than 150 lines, and no override label is provided.


- **Pipeline Run**:
    - This workflow is triggered when:
        - A PR is created/ updated.
        - A PR is merged.
    - This workflow will execute:
        - Build: Ensures the code builds successfully.
        - Run Unit Tests: All tests must pass.
        - Test Coverage Verification: Verifies that test coverage meets minimum requirements.
        - Code Quality Checks: Checkstyle and SpotBugs
        - Artifacts Upload: Build artifacts and generated reports are uploaded after pipeline run

## License

This project is licensed under the MIT License. See the `LICENSE` file for more details.
            

Raw data

            {
    "_id": null,
    "home_page": null,
    "name": "t5_grp",
    "maintainer": null,
    "docs_url": null,
    "requires_python": "<4.0,>=3.12",
    "maintainer_email": null,
    "keywords": null,
    "author": "Yoyo",
    "author_email": "wu.yuanyu@northeastern.edu",
    "download_url": "https://files.pythonhosted.org/packages/4a/fe/9d52b5465c815519993fd4b86bcd0959e716d7d91ca15435e1733dbbc4ba/t5_grp-0.1.1.tar.gz",
    "platform": null,
    "description": "# t5_grp\n\nThis project provides a tool for generating visual representations of CI/CD pipelines using data defined in YAML files. The tool leverages Jinja2 for templating and creates an HTML output that visually represents the stages and jobs within a pipeline, including their dependencies and artifacts.\n\n\n## Table of Contents\n- [Features]\n- [Development Setup]\n- - [Prerequisites]\n- - [Build Instructions]\n- [User Manual]\n- [Pull Request Process]\n- - [Creating a PR]\n- - [Rules for PRs]\n- [CI/CD Workflows]\n- [License]\n\n## Features\n- YAML Pipeline Configuration\n    - Support for multiple stages and jobs\n    - Job dependencies management\n    - Artifact tracking\n    - Allow failure flags\n- Visual Pipeline Representation\n    - Interactive HTML output\n    - Dependency arrows visualization\n    - Stage-based layout\n    - Artifact tracking across stages\n\n## Configuration Example\n```bash\npipeline:\n- name: Example Pipeline\n- stages:\n  - build\n  - test\n- jobs:\n  - name: compile\n  - stage: build\n  - script:\n   - echo \"Building...\"\n  - artifacts:\n   - paths:\n    - dist/\n```\n\n## Output Example\n```bash\nThe tool generates an HTML visualization that shows:\n- Pipeline stages in sequential order\n- Jobs within each stage\n- Dependencies between jobs (shown as arrows)\n- Artifacts produced by each job\n```\n\n## Development Setup\n\n### Prerequisites\n\nTo use this project, you need:\n\n- Python 3.12 or higher\n- Required Python packages:\n  - - Jinja2\n  - - PyYAML\n- Poetry (for dependency management)\n\n### Build Instructions\n\nClone the repository:\n```bash\ngit clone https://github.com/CS6510-SEA-F24/t5-project.git\n```\nBuild the Project:\nUsing Nox for Automated Builds, Tests, and Linting, file in `noxfile.py`:\n\nWe use nox to run automated sessions like testing, linting, and building the project.\nNox allows us to define a \"do-all\" type script to ensure everything runs in one command.\n\nTo run all sessions:\n\nInstall the dependencies using Poetry:\n\n```bash\npoetry install\n```\n\nRun application with Poetry:\n```bash\npoetry run cicd file_path\n# e.g. poetry run cicd /Users/yoyowu/NEU/t5_grp/src/tests/test_files/valid.yaml\n```\n\nRunning Tests To run all unit tests:\n```bash\npoetry run pytest\n```\n\nTo run tests with coverage reports:\n```bash\npoetry run pytest --cov=src/ --cov-report=term-missing --cov-fail-under=60\n```\n\nLint Code (Flake8): Check code style against PEP8 guidelines:\n```bash\npoetry run flake8 src\n```\n\nAuto-format Code(Black): Automatically format the code in src/ and tests/ to follow PEP8 guidelines:\n```bash\npoetry run black src\n```\n\nRun all checks (using nox)\n```bash\npoetry run nox -s all\n```\n\n### Installation\n```bash\npip install t5_grp\n```\n### Usage\n\nBasic usage:\n```bash\ncicd path/to/pipeline.yaml\n```\nWith options:\n```bash\ncicd path/to/pipeline.yaml -o custom_output.html -t dark --stage-gap 80\n```\n\n## Pull Request Process\n\n### Creating a PR\n\n#### Always use feature branch to make change:\n\n```bash\ngit checkout -b <branch_name> # create a new branch with <branch_name>\n```\n\n> Direct push to the `main` branch is strictly forbidden as this is the Production branch. All change\n> should be merged with an approved PR.\n\n#### Ensure your code is up-to-date with the `main` branch:\n\n```bash\ngit config pull.rebase true # always use rebase to reconcile divergent branches\ngit pull\n```\n\n> Regularly pull from the `main` branch avoids conflicts pilling up.\n> Please make sure you pull again before creating a PR.\n#### Follow the PR Template:\n\n- Your PR description should address any relevant context to help the reviewer to understand the\n  PR. If this is related to an issue, reference the issue in the description.\n- Make sure to use the checklist, and give explanations to any unchecked ones.\n\n#### Check PR details:\n\n- Make sure the origin and destination of the PR is correct, as well as everything in the Commits\n  and Files changed tabs before clicking \"Create Pull Request\".\n\n### Rules for PRs\n\n#### Testing:\n\n- Ensure all new code is properly tested.\n#### Commit Guidelines:\n\n- Use [meaningful commit messages](https://www.freecodecamp.org/news/how-to-write-better-git-commit-messages/).\n  Squash commits if necessary to clean up the history.\n\n#### Merging:\n\n- When merging PRs, always use **SQUASH AND MERGE** to combine all changes into a single commit.\n\n## CI/CD Workflows\n\nThis project uses **GitHub Actions** for CI/CD automation. The configured CI/CD workflows are:\n\n- **PR Size Check**:\n\n    - This workflow is triggered when a new PR is created, or when a new commit is pushed to an existing PR.\n    - It fails if the size of PR is greater than 150 lines, and no override label is provided.\n\n\n- **Pipeline Run**:\n    - This workflow is triggered when:\n        - A PR is created/ updated.\n        - A PR is merged.\n    - This workflow will execute:\n        - Build: Ensures the code builds successfully.\n        - Run Unit Tests: All tests must pass.\n        - Test Coverage Verification: Verifies that test coverage meets minimum requirements.\n        - Code Quality Checks: Checkstyle and SpotBugs\n        - Artifacts Upload: Build artifacts and generated reports are uploaded after pipeline run\n\n## License\n\nThis project is licensed under the MIT License. See the `LICENSE` file for more details.",
    "bugtrack_url": null,
    "license": "MIT",
    "summary": "A tool to generate and visualize pipeline diagrams",
    "version": "0.1.1",
    "project_urls": null,
    "split_keywords": [],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "f8503d040f70a8c9b0c7deb50a5ba1bc09d2b5d3a15b2eaa69188dea25d77f60",
                "md5": "05070a027e88e396d8c616d1bba12c0b",
                "sha256": "53d417a7f42eef4a7bd925bdf8b371deab6ddf847a8661d576811b4fc6316819"
            },
            "downloads": -1,
            "filename": "t5_grp-0.1.1-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "05070a027e88e396d8c616d1bba12c0b",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": "<4.0,>=3.12",
            "size": 37392,
            "upload_time": "2024-11-26T22:42:25",
            "upload_time_iso_8601": "2024-11-26T22:42:25.091230Z",
            "url": "https://files.pythonhosted.org/packages/f8/50/3d040f70a8c9b0c7deb50a5ba1bc09d2b5d3a15b2eaa69188dea25d77f60/t5_grp-0.1.1-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "4afe9d52b5465c815519993fd4b86bcd0959e716d7d91ca15435e1733dbbc4ba",
                "md5": "859400d250903734022b03829f2ea2e8",
                "sha256": "b2938d996dbbd75127aaecb7271fa95ddf3e3f0f10555768ac35abd5d07cbcbf"
            },
            "downloads": -1,
            "filename": "t5_grp-0.1.1.tar.gz",
            "has_sig": false,
            "md5_digest": "859400d250903734022b03829f2ea2e8",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": "<4.0,>=3.12",
            "size": 33360,
            "upload_time": "2024-11-26T22:42:27",
            "upload_time_iso_8601": "2024-11-26T22:42:27.578076Z",
            "url": "https://files.pythonhosted.org/packages/4a/fe/9d52b5465c815519993fd4b86bcd0959e716d7d91ca15435e1733dbbc4ba/t5_grp-0.1.1.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2024-11-26 22:42:27",
    "github": false,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "lcname": "t5_grp"
}
        
Elapsed time: 0.36466s