From 09bda6654e667fdb4e12e7f283590aedb1e004e5 Mon Sep 17 00:00:00 2001 From: AaronHForgeFlow Date: Fri, 22 Apr 2022 10:41:44 +0200 Subject: [PATCH] [UPDATE] update copier from template --- .copier-answers.yml | 5 ++- .eslintrc.yml | 2 +- .github/workflows/pre-commit.yml | 24 ++++++++--- .github/workflows/stale.yml | 69 ++++++++++++++++++++++++++++++++ .github/workflows/test.yml | 31 ++++++++++++-- .pre-commit-config.yaml | 6 +-- .pylintrc | 2 +- .pylintrc-mandatory | 2 +- .t2d.yml | 43 -------------------- README.md | 17 ++++---- 10 files changed, 134 insertions(+), 67 deletions(-) create mode 100644 .github/workflows/stale.yml delete mode 100644 .t2d.yml diff --git a/.copier-answers.yml b/.copier-answers.yml index 259ced78..dbce841f 100644 --- a/.copier-answers.yml +++ b/.copier-answers.yml @@ -1,14 +1,17 @@ # Do NOT update manually; changes here will be overwritten by Copier -_commit: v1.3.5 +_commit: v1.6.1 _src_path: https://github.com/OCA/oca-addons-repo-template.git ci: GitHub dependency_installation_mode: PIP generate_requirements_txt: false include_wkhtmltopdf: true odoo_version: 14.0 +org_name: ForgeFlow +org_slug: ForgeFlow rebel_module_groups: [] repo_description: Return Merchandise Authorization for Odoo repo_name: stock-rma repo_slug: https://github.com/ForgeFlow/stock-rma +repo_website: https://github.com/ForgeFlow/stock-rma travis_apt_packages: [] travis_apt_sources: [] diff --git a/.eslintrc.yml b/.eslintrc.yml index d4cc423c..9429bc68 100644 --- a/.eslintrc.yml +++ b/.eslintrc.yml @@ -4,7 +4,7 @@ env: # See https://github.com/OCA/odoo-community.org/issues/37#issuecomment-470686449 parserOptions: - ecmaVersion: 2017 + ecmaVersion: 2019 overrides: - files: diff --git a/.github/workflows/pre-commit.yml b/.github/workflows/pre-commit.yml index 4cb928ee..a7a13904 100644 --- a/.github/workflows/pre-commit.yml +++ b/.github/workflows/pre-commit.yml @@ -3,10 +3,11 @@ name: pre-commit on: pull_request: branches: - - "14.0" + - "14.0*" push: branches: - "14.0" + - "14.0-ocabot-*" jobs: pre-commit: @@ -14,8 +15,21 @@ jobs: steps: - uses: actions/checkout@v2 - uses: actions/setup-python@v2 + - name: Get python version + run: echo "PY=$(python -VV | sha256sum | cut -d' ' -f1)" >> $GITHUB_ENV + - uses: actions/cache@v1 with: - # The pylint-odoo version we use here does not support python 3.10 - # https://github.com/OCA/oca-addons-repo-template/issues/80 - python-version: "3.9" - - uses: pre-commit/action@v2.0.0 + path: ~/.cache/pre-commit + key: pre-commit|${{ env.PY }}|${{ hashFiles('.pre-commit-config.yaml') }} + - name: Install pre-commit + run: pip install pre-commit + - name: Run pre-commit + run: pre-commit run --all-files --show-diff-on-failure --color=always + - name: Check that all files generated by pre-commit are in git + run: | + newfiles="$(git ls-files --others --exclude-from=.gitignore)" + if [ "$newfiles" != "" ] ; then + echo "Please check-in the following files:" + echo "$newfiles" + exit 1 + fi diff --git a/.github/workflows/stale.yml b/.github/workflows/stale.yml new file mode 100644 index 00000000..1693a125 --- /dev/null +++ b/.github/workflows/stale.yml @@ -0,0 +1,69 @@ +name: Mark stale issues and pull requests + +on: + schedule: + - cron: "0 12 * * 0" + +jobs: + stale: + runs-on: ubuntu-latest + steps: + - name: Stale PRs and issues policy + uses: actions/stale@v4 + with: + repo-token: ${{ secrets.GITHUB_TOKEN }} + # General settings. + ascending: true + remove-stale-when-updated: true + # Pull Requests settings. + # 120+30 day stale policy for PRs + # * Except PRs marked as "no stale" + days-before-pr-stale: 120 + days-before-pr-close: 30 + exempt-pr-labels: "no stale" + stale-pr-label: "stale" + stale-pr-message: > + There hasn't been any activity on this pull request in the past 4 months, so + it has been marked as stale and it will be closed automatically if no + further activity occurs in the next 30 days. + + If you want this PR to never become stale, please ask a PSC member to apply + the "no stale" label. + # Issues settings. + # 180+30 day stale policy for open issues + # * Except Issues marked as "no stale" + days-before-issue-stale: 180 + days-before-issue-close: 30 + exempt-issue-labels: "no stale,needs more information" + stale-issue-label: "stale" + stale-issue-message: > + There hasn't been any activity on this issue in the past 6 months, so it has + been marked as stale and it will be closed automatically if no further + activity occurs in the next 30 days. + + If you want this issue to never become stale, please ask a PSC member to + apply the "no stale" label. + + # 15+30 day stale policy for issues pending more information + # * Issues that are pending more information + # * Except Issues marked as "no stale" + - name: Needs more information stale issues policy + uses: actions/stale@v4 + with: + repo-token: ${{ secrets.GITHUB_TOKEN }} + ascending: true + only-labels: "needs more information" + exempt-issue-labels: "no stale" + days-before-stale: 15 + days-before-close: 30 + days-before-pr-stale: -1 + days-before-pr-close: -1 + remove-stale-when-updated: true + stale-issue-label: "stale" + stale-issue-message: > + This issue needs more information and there hasn't been any activity + recently, so it has been marked as stale and it will be closed automatically + if no further activity occurs in the next 30 days. + + If you think this is a mistake, please ask a PSC member to remove the "needs + more information" label. diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index dc92cb84..4133a9a8 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -1,24 +1,45 @@ -name: test Odoo addons +name: tests on: pull_request: branches: - - "14.0" + - "14.0*" push: branches: - "14.0" + - "14.0-ocabot-*" jobs: + unreleased-deps: + runs-on: ubuntu-latest + name: Detect unreleased dependencies + steps: + - uses: actions/checkout@v2 + - run: | + for reqfile in requirements.txt test-requirements.txt ; do + if [ -f ${reqfile} ] ; then + result=0 + # reject non-comment lines that contain a / (i.e. URLs, relative paths) + grep "^[^#].*/" ${reqfile} || result=$? + if [ $result -eq 0 ] ; then + echo "Unreleased dependencies found in ${reqfile}." + exit 1 + fi + fi + done test: runs-on: ubuntu-latest container: ${{ matrix.container }} + name: ${{ matrix.name }} strategy: fail-fast: false matrix: include: - container: ghcr.io/oca/oca-ci/py3.6-odoo14.0:latest makepot: "true" + name: test with Odoo - container: ghcr.io/oca/oca-ci/py3.6-ocb14.0:latest + name: test with OCB services: postgres: image: postgres:9.6 @@ -34,6 +55,10 @@ jobs: persist-credentials: false - name: Install addons and dependencies run: oca_install_addons + - name: Check licenses + run: manifestoo -d . check-licenses + - name: Check development status + run: manifestoo -d . check-dev-status --default-dev-status=Beta - name: Initialize test db run: oca_init_test_database - name: Run tests @@ -41,4 +66,4 @@ jobs: - uses: codecov/codecov-action@v1 - name: Update .pot files run: oca_export_and_push_pot https://x-access-token:${{ secrets.GIT_PUSH_TOKEN }}@github.com/${{ github.repository }} - if: ${{ matrix.makepot == 'true' && github.event_name == 'push' && github.repository_owner == 'OCA' }} + if: ${{ matrix.makepot == 'true' && github.event_name == 'push' && github.repository_owner == 'ForgeFlow' }} diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 5d875636..9ba65a83 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -46,7 +46,7 @@ repos: - --remove-duplicate-keys - --remove-unused-variables - repo: https://github.com/psf/black - rev: 20.8b1 + rev: 22.3.0 hooks: - id: black - repo: https://github.com/pre-commit/mirrors-prettier @@ -114,7 +114,7 @@ repos: name: flake8 additional_dependencies: ["flake8-bugbear==20.1.4"] - repo: https://github.com/PyCQA/pylint - rev: pylint-2.5.3 + rev: v2.11.1 hooks: - id: pylint name: pylint with optional checks @@ -123,7 +123,7 @@ repos: - --exit-zero verbose: true additional_dependencies: &pylint_deps - - pylint-odoo==3.5.0 + - pylint-odoo==5.0.5 - id: pylint name: pylint with mandatory checks args: diff --git a/.pylintrc b/.pylintrc index e3c5b8e3..13833ade 100644 --- a/.pylintrc +++ b/.pylintrc @@ -4,7 +4,7 @@ score=n [ODOOLINT] readme_template_url="https://github.com/OCA/maintainer-tools/blob/master/template/module/README.rst" -manifest_required_authors=Odoo Community Association (OCA) +manifest_required_authors=ForgeFlow manifest_required_keys=license manifest_deprecated_keys=description,active license_allowed=AGPL-3,GPL-2,GPL-2 or any later version,GPL-3,GPL-3 or any later version,LGPL-3 diff --git a/.pylintrc-mandatory b/.pylintrc-mandatory index 0d440de1..771e7c4b 100644 --- a/.pylintrc-mandatory +++ b/.pylintrc-mandatory @@ -4,7 +4,7 @@ score=n [ODOOLINT] readme_template_url="https://github.com/OCA/maintainer-tools/blob/master/template/module/README.rst" -manifest_required_authors=Odoo Community Association (OCA) +manifest_required_authors=ForgeFlow manifest_required_keys=license manifest_deprecated_keys=description,active license_allowed=AGPL-3,GPL-2,GPL-2 or any later version,GPL-3,GPL-3 or any later version,LGPL-3 diff --git a/.t2d.yml b/.t2d.yml deleted file mode 100644 index de169445..00000000 --- a/.t2d.yml +++ /dev/null @@ -1,43 +0,0 @@ -language: python -cache: - directories: - - $HOME/.cache/pip - - $HOME/.cache/pre-commit - -python: - - "3.6" - -addons: - postgresql: "9.6" - apt: - packages: - - expect-dev # provides unbuffer utility - -stages: - - test - -jobs: - include: - - stage: test - env: - - TESTS=1 ODOO_REPO="odoo/odoo" MAKEPOT="1" - - stage: test - env: - - TESTS=1 ODOO_REPO="OCA/OCB" -env: - global: - - VERSION="14.0" TESTS="0" LINT_CHECK="0" MAKEPOT="0" - - WKHTMLTOPDF_VERSION="0.12.5" - - MQT_DEP=PIP - -install: - - git clone --depth=1 https://github.com/OCA/maintainer-quality-tools.git - ${HOME}/maintainer-quality-tools - - export PATH=${HOME}/maintainer-quality-tools/travis:${PATH} - - travis_install_nightly - -script: - - travis_run_tests - -after_success: - - travis_after_tests_success diff --git a/README.md b/README.md index 72999028..41dfecc9 100644 --- a/README.md +++ b/README.md @@ -1,7 +1,9 @@ -[![Runbot Status](https://runbot.odoo-community.org/runbot/badge/flat/88/14.0.svg)](https://runbot.odoo-community.org/runbot/repo/github-com-oca-stock-rma-88) -[![Build Status](https://travis-ci.com/OCA/stock-rma.svg?branch=14.0)](https://travis-ci.com/OCA/stock-rma) -[![codecov](https://codecov.io/gh/OCA/stock-rma/branch/14.0/graph/badge.svg)](https://codecov.io/gh/OCA/stock-rma) -[![Translation Status](https://translation.odoo-community.org/widgets/stock-rma-14-0/-/svg-badge.svg)](https://translation.odoo-community.org/engage/stock-rma-14-0/?utm_source=widget) + + +[![Pre-commit Status](https://github.com/ForgeFlow/https://github.com/ForgeFlow/stock-rma/actions/workflows/pre-commit.yml/badge.svg?branch=14.0)](https://github.com/ForgeFlow/https://github.com/ForgeFlow/stock-rma/actions/workflows/pre-commit.yml?query=branch%3A14.0) +[![Build Status](https://github.com/ForgeFlow/https://github.com/ForgeFlow/stock-rma/actions/workflows/test.yml/badge.svg?branch=14.0)](https://github.com/ForgeFlow/https://github.com/ForgeFlow/stock-rma/actions/workflows/test.yml?query=branch%3A14.0) +[![codecov](https://codecov.io/gh/ForgeFlow/https://github.com/ForgeFlow/stock-rma/branch/14.0/graph/badge.svg)](https://codecov.io/gh/ForgeFlow/https://github.com/ForgeFlow/stock-rma) + @@ -25,12 +27,9 @@ This part will be replaced when running the oca-gen-addons-table script from OCA This repository is licensed under [AGPL-3.0](LICENSE). -However, each module can have a totally different license, as long as they adhere to OCA +However, each module can have a totally different license, as long as they adhere to ForgeFlow policy. Consult each module's `__manifest__.py` file, which contains a `license` key that explains its license. ---- - -OCA, or the [Odoo Community Association](http://odoo-community.org/), is a nonprofit -organization whose mission is to support the collaborative development of Odoo features -and promote its widespread use. +