Skip to content

Commit c1b1c80

Browse files
sunil-lakshmanharshithad0703ishaileshmishra
authored
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>
1 parent d84e1ef commit c1b1c80

File tree

316 files changed

+19908
-1117
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

316 files changed

+19908
-1117
lines changed

.DS_Store

0 Bytes
Binary file not shown.

.github/workflows/release.yml

Lines changed: 29 additions & 71 deletions
Original file line numberDiff line numberDiff line change
@@ -1,81 +1,39 @@
1-
# this file is *not* meant to cover or endorse the use of GitHub Actions, but rather to
2-
# help make automated releases for this project
1+
# This workflow will upload a Python Package using Twine when a release is created
2+
# For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-python#publishing-to-package-registries
33

4-
name: Release
4+
# This workflow uses actions that are not certified by GitHub.
5+
# They are provided by a third-party and are governed by
6+
# separate terms of service, privacy policy, and support
7+
# documentation.
8+
9+
name: Upload Python Package
510

611
on:
712
release:
8-
types: [created]
13+
types: [published]
14+
15+
permissions:
16+
contents: read
917

1018
jobs:
11-
build-and-publish:
12-
runs-on: ubuntu-22.04
19+
deploy:
20+
21+
runs-on: ubuntu-latest
22+
1323
steps:
14-
- name: Checkout
15-
uses: actions/checkout@v2
24+
- uses: actions/checkout@v3
1625
- name: Set up Python
17-
uses: actions/setup-python@v1
26+
uses: actions/setup-python@v3
1827
with:
19-
python-version: "3.10.11"
20-
- name: Install build dependencies
21-
run: python -m pip install -U setuptools wheel build
22-
- name: Build
23-
run: python -m build .
24-
- name: Publish
25-
uses: pypa/gh-action-pypi-publish@master
28+
python-version: '3.x'
29+
- name: Install dependencies
30+
run: |
31+
python -m pip install --upgrade pip
32+
pip install build
33+
- name: Build package
34+
run: python -m build
35+
- name: Publish package
36+
uses: pypa/gh-action-pypi-publish@27b31702a0e7fc50959f5ad993c78deac1bdfc29
2637
with:
27-
password: ${{ secrets.pypi_test_password }}
28-
skip_existing: true
29-
30-
generate_and_upload_coverage:
31-
name: Generate and Upload Coverage Report
32-
runs-on: ubuntu-22.04
33-
strategy:
34-
fail-fast: false
35-
matrix:
36-
python-version: ["3.10.11"]
37-
38-
steps:
39-
- name: Checkout code
40-
uses: actions/checkout@v2
41-
42-
- name: Set up Python
43-
uses: actions/setup-python@v2
44-
with:
45-
python-version: ${{ matrix.python-version }}
46-
47-
- name: Update Pip
48-
run: pip install --upgrade pip
49-
pip install --use-pep517
50-
51-
- name: Create and activate virtual environment
52-
run: |
53-
python -m venv venv
54-
source venv/bin/activate
55-
56-
- name: Install build dependencies
57-
run: python -m pip install -U setuptools wheel build
58-
59-
- name: Install dependencies
60-
run: pip install -r requirements.txt
61-
62-
- name: Run tests and generate coverage report
63-
run: |
64-
coverage run -m pytest
65-
coverage report -m > coverage.txt
66-
67-
- name: Archive coverage report
68-
uses: actions/upload-artifact@v2
69-
with:
70-
name: coverage-report
71-
path: coverage.txt
72-
73-
- name: Configure AWS credentials
74-
uses: aws-actions/configure-aws-credentials@v1
75-
with:
76-
aws-access-key-id: ${{ secrets.Test_AWS_ACCESS_KEY_ID }}
77-
aws-secret-access-key: ${{ secrets.Test_AWS_SECRET_ACCESS_KEY }}
78-
aws-region: <your_aws_region> # Replace with your actual AWS region
79-
80-
- name: Upload coverage report to S3
81-
run: aws s3 cp coverage.txt s3://<your_bucket_name>/coverage.txt
38+
user: __token__
39+
password: ${{ secrets.PYPI_API_TOKEN }}

.github/workflows/sast-scan.yml

Lines changed: 0 additions & 11 deletions
This file was deleted.

.github/workflows/secrets-scan.yml

Lines changed: 0 additions & 11 deletions
This file was deleted.

.github/workflows/unit-test.yml

Lines changed: 41 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -1,43 +1,48 @@
1-
name: Pytest Workflow
1+
name: Coverage Report
22

3-
on:
4-
push:
5-
branches:
6-
- main
7-
pull_request:
8-
branches:
9-
- main
3+
on: [push] # You can adjust the trigger events as needed
104

115
jobs:
12-
coverage-report:
13-
strategy:
14-
matrix:
15-
python-version:
16-
- 3.9
6+
coverage:
177
runs-on: ubuntu-latest
8+
189
steps:
19-
- uses: actions/checkout@v2
20-
- uses: actions/setup-python@v2
21-
with:
22-
python-version: ${{ matrix.python-version }}
23-
- name: Install build dependencies
24-
run: pip install --upgrade setuptools
25-
- name: Install dot env
26-
run: pip install python-dotenv
27-
- name: Install requests
28-
run: pip install requests
29-
- uses: lpenz/ghaction-pytest-cov@v1
30-
- uses: AndreMiras/coveralls-python-action@v20201129
10+
- name: Checkout code
11+
uses: actions/checkout@v2
12+
13+
- name: Set up Python
14+
uses: actions/setup-python@v2
3115
with:
32-
parallel: true
33-
flag-name: python-${{ matrix.python-version }}
34-
github-token: ${{ secrets.GITHUB_TOKEN }}
35-
36-
37-
coverage-finish:
38-
needs: coverage-report
39-
runs-on: ubuntu-latest
40-
steps:
41-
- uses: AndreMiras/coveralls-python-action@v20201129
16+
python-version: 3.11 # Choose the appropriate Python version
17+
18+
- name: Install dependencies
19+
run: |
20+
python -m pip install --upgrade pip
21+
pip install -r requirements.txt # If you have a requirements file
22+
pip install coverage
23+
pip install pytest
24+
pip install coverage-badge
25+
26+
27+
- name: Run tests and coverage
28+
run: |
29+
coverage run -m pytest tests/unit/
30+
coverage report --include="tests/unit/*" -m > coverage_report.txt
31+
coverage xml --include="tests/unit/*" -o coverage.xml
32+
coverage html --include="tests/unit/*"
33+
coverage-badge -o coverage.svg
34+
35+
- name: Upload coverage artifact
36+
uses: actions/upload-artifact@v2
4237
with:
43-
parallel-finished: true
38+
name: coverage-report
39+
path: |
40+
coverage_report.txt
41+
coverage.xml
42+
htmlcov
43+
coverage.svg
44+
- name: Upload coverage reports to Codecov
45+
uses: codecov/codecov-action@v3
46+
env:
47+
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
48+

.gitignore

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -128,6 +128,7 @@ dmypy.json
128128
# Pyre type checker
129129
.pyre/
130130
tests/config/default.yml
131+
131132
.talismanrc
132133
.vscode/settings.json
133134
run.py
@@ -136,4 +137,4 @@ tests/resources/.DS_Store
136137
tests/.DS_Store
137138
tests/resources/.DS_Store
138139
.DS_Store
139-
.talismanrc
140+
.talismanrc

.idea/contentstack-management-python.iml

Lines changed: 15 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

.idea/inspectionProfiles/profiles_settings.xml

Lines changed: 6 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

.idea/modules.xml

Lines changed: 8 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

.idea/vcs.xml

Lines changed: 6 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)