Skip to content
Merged

Next #23

Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
Prev Previous commit
Feat/cs 40287 workflow class implemetation (#14)
* feat: ✨ implemented branches and aliases with unit and api test cases

* test: ✅ added mock tests for branches and aliases

* docs: 📝 added api documentation for branches and aliases

* feat: ✨ content type implementation with api references, unit test cases and api test cases

* test: renamed the api, mock, unit test file names of branch and alias

* test: renamed file path in branch and alias mock tests

* test: improved coverage report for branches and aliases

* test: Added mock test cases for content type

* docs: 📝 Cleared typo errors

* test: removed unwanted test files

* refactor: Code improvement for branches, aliases and content type implementation

* - General code improvements
- Testcases improvements

* - General code improvements
- Testcases improvements

* - General code improvements
- Formats are updated

* code enhancement

* Created Entry class and test cases

Created Entry Class
created entry class test cases

* feat: ✨ asset class implementation with tests and api docs

* Code improvements and changed test cases to new structure

* test: ✅ added resources and made some changes in api and unit test cases

* Updated Unit test cases.

* Webhook class Implementation

* Created workflow class

* Deleted secrets-scan.yml file

* Updated variable name

* Deleted sast-scan.yml file

* Feat/cs 40545 metadata class implemetation (#15)

* Metadata class implementation

* Deleted sast-scan.yml file

* Fixed PR comments

* Code optimisation and handling custom error exception

* Removed uids

* Feat/cs 40549 roles class implementation (#16)

* Created roles class with unit testcases, mock test cases and api test cases

* Updated coverage report github workflow file

* Added coverage install command

* Added pytest install command

* Updated stack class unit test file

* Added html coverage

* Added coverage reports and visualizations

* Removed visualisation

* Generating coverage report in svg format

* Added coverage-badge  install command

* Fixed PR comments and code optimisation

* Added coverage reports graphical visualisation in github page

* Created readme file

* changed variable name

* Updated readme file

* Update README.md

* Added auditlog class and license file (#17)

* Added auditlog class and license file

* Added test case for invalid inputs

* commented the idiom

It Allows You to Execute Code When the File Runs as a Script, but Not When It’s Imported as a Module

---------

Co-authored-by: Shailesh Mishra <mobile@contentstack.com>

---------

Co-authored-by: Shailesh Mishra <mobile@contentstack.com>

* Developed environment class implementation (#19)

* Developed environment class implementation

* Updated variable name

* Added CI-CD implementation (#20)

* Added CI-CD implementation

Added CICD implemetation
Updated code Optimization
Updated code for check package in test environment.

* Removed Unused files

* Feat/cs 41198 locale class implementation (#21)

* Added locale class implementation

* Implemented  taxonomy support (#22)

---------

Co-authored-by: harshithad0703 <harshitha.d@contentstack.com>
Co-authored-by: Shailesh Mishra <mshaileshr@gmail.com>
Co-authored-by: Shailesh Mishra <mobile@contentstack.com>
  • Loading branch information
4 people authored Sep 8, 2023
commit c1b1c80f55a843238d5d02e3c3fe2751abff0855
Binary file modified .DS_Store
Binary file not shown.
100 changes: 29 additions & 71 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -1,81 +1,39 @@
# this file is *not* meant to cover or endorse the use of GitHub Actions, but rather to
# help make automated releases for this project
# This workflow will upload a Python Package using Twine when a release is created
# For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-python#publishing-to-package-registries

name: Release
# This workflow uses actions that are not certified by GitHub.
# They are provided by a third-party and are governed by
# separate terms of service, privacy policy, and support
# documentation.

name: Upload Python Package

on:
release:
types: [created]
types: [published]

permissions:
contents: read

jobs:
build-and-publish:
runs-on: ubuntu-22.04
deploy:

runs-on: ubuntu-latest

steps:
- name: Checkout
uses: actions/checkout@v2
- uses: actions/checkout@v3
- name: Set up Python
uses: actions/setup-python@v1
uses: actions/setup-python@v3
with:
python-version: "3.10.11"
- name: Install build dependencies
run: python -m pip install -U setuptools wheel build
- name: Build
run: python -m build .
- name: Publish
uses: pypa/gh-action-pypi-publish@master
python-version: '3.x'
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install build
- name: Build package
run: python -m build
- name: Publish package
uses: pypa/gh-action-pypi-publish@27b31702a0e7fc50959f5ad993c78deac1bdfc29
with:
password: ${{ secrets.pypi_test_password }}
skip_existing: true

generate_and_upload_coverage:
name: Generate and Upload Coverage Report
runs-on: ubuntu-22.04
strategy:
fail-fast: false
matrix:
python-version: ["3.10.11"]

steps:
- name: Checkout code
uses: actions/checkout@v2

- name: Set up Python
uses: actions/setup-python@v2
with:
python-version: ${{ matrix.python-version }}

- name: Update Pip
run: pip install --upgrade pip
pip install --use-pep517

- name: Create and activate virtual environment
run: |
python -m venv venv
source venv/bin/activate

- name: Install build dependencies
run: python -m pip install -U setuptools wheel build

- name: Install dependencies
run: pip install -r requirements.txt

- name: Run tests and generate coverage report
run: |
coverage run -m pytest
coverage report -m > coverage.txt

- name: Archive coverage report
uses: actions/upload-artifact@v2
with:
name: coverage-report
path: coverage.txt

- name: Configure AWS credentials
uses: aws-actions/configure-aws-credentials@v1
with:
aws-access-key-id: ${{ secrets.Test_AWS_ACCESS_KEY_ID }}
aws-secret-access-key: ${{ secrets.Test_AWS_SECRET_ACCESS_KEY }}
aws-region: <your_aws_region> # Replace with your actual AWS region

- name: Upload coverage report to S3
run: aws s3 cp coverage.txt s3://<your_bucket_name>/coverage.txt
user: __token__
password: ${{ secrets.PYPI_API_TOKEN }}
11 changes: 0 additions & 11 deletions .github/workflows/sast-scan.yml

This file was deleted.

11 changes: 0 additions & 11 deletions .github/workflows/secrets-scan.yml

This file was deleted.

77 changes: 41 additions & 36 deletions .github/workflows/unit-test.yml
Original file line number Diff line number Diff line change
@@ -1,43 +1,48 @@
name: Pytest Workflow
name: Coverage Report

on:
push:
branches:
- main
pull_request:
branches:
- main
on: [push] # You can adjust the trigger events as needed

jobs:
coverage-report:
strategy:
matrix:
python-version:
- 3.9
coverage:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v2
- uses: actions/setup-python@v2
with:
python-version: ${{ matrix.python-version }}
- name: Install build dependencies
run: pip install --upgrade setuptools
- name: Install dot env
run: pip install python-dotenv
- name: Install requests
run: pip install requests
- uses: lpenz/ghaction-pytest-cov@v1
- uses: AndreMiras/coveralls-python-action@v20201129
- name: Checkout code
uses: actions/checkout@v2

- name: Set up Python
uses: actions/setup-python@v2
with:
parallel: true
flag-name: python-${{ matrix.python-version }}
github-token: ${{ secrets.GITHUB_TOKEN }}


coverage-finish:
needs: coverage-report
runs-on: ubuntu-latest
steps:
- uses: AndreMiras/coveralls-python-action@v20201129
python-version: 3.11 # Choose the appropriate Python version

- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install -r requirements.txt # If you have a requirements file
pip install coverage
pip install pytest
pip install coverage-badge


- name: Run tests and coverage
run: |
coverage run -m pytest tests/unit/
coverage report --include="tests/unit/*" -m > coverage_report.txt
coverage xml --include="tests/unit/*" -o coverage.xml
coverage html --include="tests/unit/*"
coverage-badge -o coverage.svg

- name: Upload coverage artifact
uses: actions/upload-artifact@v2
with:
parallel-finished: true
name: coverage-report
path: |
coverage_report.txt
coverage.xml
htmlcov
coverage.svg
- name: Upload coverage reports to Codecov
uses: codecov/codecov-action@v3
env:
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}

3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -128,6 +128,7 @@ dmypy.json
# Pyre type checker
.pyre/
tests/config/default.yml

.talismanrc
.vscode/settings.json
run.py
Expand All @@ -136,4 +137,4 @@ tests/resources/.DS_Store
tests/.DS_Store
tests/resources/.DS_Store
.DS_Store
.talismanrc
.talismanrc
15 changes: 15 additions & 0 deletions .idea/contentstack-management-python.iml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 6 additions & 0 deletions .idea/inspectionProfiles/profiles_settings.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 8 additions & 0 deletions .idea/modules.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 6 additions & 0 deletions .idea/vcs.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading