profile
viewpoint
Ernesto Tejeda ernestotejeda Tecnativa

ernestotejeda/account-analytic 0

Odoo Account Analytic Related Addons

ernestotejeda/account-invoicing 0

Odoo Invoicing Extension Addons

ernestotejeda/crm 0

Odoo CRM, Mail & Newsletter advanced features

ernestotejeda/e-commerce 0

Odoo E-Commerce server automation addons

ernestotejeda/eficent-odoo-addons 0

Eficent's Odoo addons

ernestotejeda/knowledge 0

Odoo Document & Knowledge Management

ernestotejeda/maintainer-tools 0

Odoo Maintainers Tools & conventions for OCA members which evaluate and maintain repositories.

ernestotejeda/odoo 0

Odoo. Open Source Apps To Grow Your Business.

ernestotejeda/OpenUpgrade 0

Open source upgrade path for Odoo/OpenERP

ernestotejeda/product-attribute 0

Odoo Product Attribute

issue commentOCA/odoo-community.org

issue with odoo-community apps download after upgrade

It seems there is another download issue, though: https://github.com/OCA/apps-store/issues/78

farazda1

comment created time in a month

issue commentOCA/odoo-community.org

issue with odoo-community apps download after upgrade

This is now deployed. Thanks for the fix!

farazda1

comment created time in a month

issue openedOCA/maintainer-tools

oca-github-login failing

Steps to reproduce

  1. reading readme in order to get involved
  2. git clone and pipx install ./maintainer-tools
  3. start with oca-github-login pniederlag

Current behavior

Two-Factor-Auth is enabled on my account

oca-github-login pniederlag
Password for pniederlag: 
Traceback (most recent call last):
  File "/home/pn/.local/bin/oca-github-login", line 8, in <module>
    sys.exit(main())
  File "/home/pn/.local/pipx/venvs/oca-maintainers-tools/lib/python3.6/site-packages/tools/github_login.py", line 78, in main
    authorize_token(args.username)
  File "/home/pn/.local/pipx/venvs/oca-maintainers-tools/lib/python3.6/site-packages/tools/github_login.py", line 54, in authorize_token
    two_factor_callback=two_factor_prompt)
  File "/home/pn/.local/pipx/venvs/oca-maintainers-tools/lib/python3.6/site-packages/github3/api.py", line 29, in deprecation_wrapper
    return func(*args, **kwargs)
  File "/home/pn/.local/pipx/venvs/oca-maintainers-tools/lib/python3.6/site-packages/github3/api.py", line 72, in authorize
    username, password, scopes, note, note_url, client_id, client_secret
  File "/home/pn/.local/pipx/venvs/oca-maintainers-tools/lib/python3.6/site-packages/github3/github.py", line 503, in authorize
    json = self._json(self._post(url, data=data), 201)
  File "/home/pn/.local/pipx/venvs/oca-maintainers-tools/lib/python3.6/site-packages/github3/models.py", line 156, in _json
    raise exceptions.error_for(response)
github3.exceptions.NotFoundError: 404 Not Found

### Expected behavior

- token is added

### Workaround

- run python tools/config.py creates a oca.cfg in current directory
- create token with necessary permissions on personal github account
- Add github username and token in oca.cfg

created time in a month

issue openedOCA/maintainer-tools

repo search-engine is missing

Steps to reproduce

  1. run oca-clone-everything

Current behavior

failure on cloning search-engine

Bitte stellen Sie sicher, dass die korrekten Zugriffsberechtigungen bestehen
und das Repository existiert.
fatal: Kein Git-Repository: 'search-engine/.git'

other repos did checkout fine

Expected behavior

all listed projects checkout

created time in a month

issue commentOCA/odoo-community.org

issue with odoo-community apps download after upgrade

Fixed already in https://github.com/OCA/apps-store/commit/42a333937c9380ba69cb07a27aa7d48a3681aa1c, but not deployed.

@sbidoul can you deploy it?

farazda1

comment created time in a month

GollumEvent
GollumEvent

push eventOCA/maintainer-tools

Stéphane Bidoul

commit sha f949a35cb39f6c26b4bf84ca80bec6482058cfaa

pypi_upload: do not depend on undocumented wheel api

view details

Stéphane Bidoul

commit sha 2a6d500bb0818afbbd60af3fbf69228bd4d62a67

pypi_upload: remove python2 support

view details

Stéphane Bidoul

commit sha f2d1be9daceb2cccc102ae2be44891ce4a0ed3a0

Merge pull request #487 from acsone/fix-pypi-upload-sbi Fix oca-pypi-upload

view details

push time in a month

PR opened OCA/maintainer-tools

Fix oca-pypi-upload
+3 -13

0 comment

1 changed file

pr created time in a month

issue commentOCA/maintainer-tools

Proposal: versionless branches

This approach can be partially applied, while keeping current structure of repositories. So, instead of making few pull requests with different code, you can prepare a single PR and let robots make others PRs. I kind of use it, but instead of code that checks odoo version, I make a comment like

import openerp as odoo
# In Odoo 10.0 use following:
# import odoo

So, I make a PR to 9.0, then it's merged, me or a robot move the code to v10 and then I update the code according to existing comments without thinking about it much.

For python and maybe js it can be easily automated by checking odoo version. For xml this requires updates in odoo framework.

Yajo

comment created time in a month

Pull request review commentOCA/maintainer-tools

[ADD] oca-copier-update

+"""Run copier update on a branch in all addons repos.+"""+from pathlib import Path+import subprocess+import textwrap+from typing import Optional++import click+import requests++from .gitutils import commit_if_needed+from .oca_projects import BranchNotFoundError, get_repositories, temporary_clone+++ORG = "OCA"+++def _make_update_dotfiles_branch(branch: str) -> str:+    return f"{branch}-ocabot-update-dotfiles"+++def _make_commit_msg(ci_skip: bool) -> str:+    msg = "[IMP] update dotfiles"+    if ci_skip:+        msg += " [ci skip]"+    return msg+++def _get_update_dotfiles_open_pr(org: str, repo: str, branch: str) -> Optional[str]:+    r = requests.get(+        f"https://api.github.com/repos"+        f"/{org}/{repo}/pulls"+        f"?base={branch}&head=OCA:{_make_update_dotfiles_branch(branch)}"+    )+    r.raise_for_status()+    prs = r.json()+    if not prs:+        return None+    pr = prs[0]+    if pr["state"] == "open":+        return pr["number"]+    return None+++def _make_update_dotfiles_pr(org: str, repo: str, branch: str) -> None:+    subprocess.check_call(+        ["git", "checkout", "-B", _make_update_dotfiles_branch(branch)]+    )+    subprocess.check_call(["git", "add", "."])+    subprocess.check_call(["git", "commit", "-m", _make_commit_msg(ci_skip=False)])+    subprocess.check_call(["git", "push", "-f"])+    if not _get_update_dotfiles_open_pr(org, repo, branch):+        subprocess.check_call(+            [+                "gh",+                "pr",+                "create",+                "--repo",+                f"{org}/{repo}",+                "--base",+                branch,+                "--title",+                f"[{branch}] dotfiles update needs manual intervention",+                "--body",+                textwrap.dedent(+                    """\+                        Dear maintainer,++                        After updating the dotfiles, `pre-commit run -a`+                        fails in a manner that cannot be resolved automatically.++                        Can you please have a look, fix and merge?++                        Thanks,+                    """+                ),+                "--label",+                "help wanted",+            ]+        )+++@click.command()+@click.argument("branch")+def main(branch: str) -> None:+    for repo in get_repositories():+        try:+            with temporary_clone(repo, branch):+                print("=" * 10, repo, "=" * 10)+                # set git user/email+                subprocess.check_call(+                    ["git", "config", "user.name", "oca-git-bot"],+                )+                subprocess.check_call(+                    ["git", "config", "user.email", "oca-git-bot@odoo-community.org"],+                )+                if not Path(".copier-answers.yml").exists():+                    print(f"Skipping {repo} because it has no .copier-answers.yml")+                    continue+                r = subprocess.call(["copier", "-f", "update"])+                if r != 0:+                    print("$" * 10, f"copier update failed on {repo}")+                    continue+                # git add updated files so pre-commit run -a will pick them up+                # (notably newly created .rej files)+                subprocess.check_call(["git", "add", "."])+                # run up to 3 pre-commit passes, in case autofixers+                # (which cause pre-commit to fail when they change files)+                # resolve issues+                for _ in range(3):+                    r = subprocess.call(["pre-commit", "run", "-a"])+                    # git add, in case pre-commit created new files+                    subprocess.check_call(["git", "add", "."])+                    if r == 0:+                        break

I think this part should be a little bit improved.

There's 2 things here that are merged but should be IMHO split.

The 1st thing is to reformat dotfiles themselves. This is desired as they will almost 100% of the time will fail (beause .copier-answers.yml has to be reformated always).

The 2nd thing is to reformat all the rest of source code.

If you're migrating a module and extract the git history from older branch, and then find in between commits labeled like [IMP] update dotfiles, but the real change is not in dotfiles but in source code, that can be a little misleading. Besides, having a clear separation between what's updated by copier and what by pre-commit (in other parts) is also helpful to later debug if there's a problem in the template or in pre-commit configuration.

So, I think it would be better like this (pseudocode):

failed = False

# Update from copier and reformat its changes
_run_copier()
for n in range(3):
    try:
        pre_commit("install")
        git("add", ".")
        git("commit", "-m", "[IMP] update dotfiles")
    except ProcessError:
        if n == 2:
            failed = True
            git("commit", "-m", "[IMP] update dotfiles", "--no-verify")

# Reformat all other code if needed
try:
    pre_commit("run", "-a")
except ProcessError:
    git("add", ".")
    try:
        git("commit", "-m", "[IMP] pre-commit run")
    except ProcessError:
        git("commit", "-m", "[IMP] pre-commit run", "--no-verify")
        failed = True

# Open PR because it failed
if failed:
    _make_update_dotfiles_pr(ORG, repo, branch)
sbidoul

comment created time in a month

Pull request review commentOCA/maintainer-tools

[ADD] oca-copier-update

+"""Run copier update on a branch in all addons repos.+"""+from pathlib import Path+import subprocess+import textwrap+from typing import Optional++import click+import requests++from .gitutils import commit_if_needed+from .oca_projects import BranchNotFoundError, get_repositories, temporary_clone+++ORG = "OCA"+++def _make_update_dotfiles_branch(branch):+    return f"{branch}-ocabot-update-dotfiles"+++def _make_commit_msg(ci_skip: bool) -> str:+    msg = "[IMP] update dotfiles"+    if ci_skip:+        msg += " [ci skip]"+    return msg+++def _get_update_dotfiles_open_pr(org: str, repo: str, branch: str) -> Optional[str]:+    r = requests.get(+        f"https://api.github.com/repos"+        f"/{org}/{repo}/pulls"+        f"?base={branch}&head=OCA:{_make_update_dotfiles_branch(branch)}"+    )+    r.raise_for_status()+    prs = r.json()+    if not prs:+        return None+    pr = prs[0]+    if pr["state"] == "open":+        return pr["number"]+    return None+++def _make_update_dotfiles_pr(org: str, repo: str, branch: str) -> None:+    subprocess.check_call(+        ["git", "checkout", "-B", _make_update_dotfiles_branch(branch)]+    )+    subprocess.check_call(["git", "add", "."])+    subprocess.check_call(["git", "commit", "-m", _make_commit_msg(ci_skip=False)])+    subprocess.check_call(["git", "push", "-f"])+    if not _get_update_dotfiles_open_pr(org, repo, branch):+        subprocess.check_call(+            [+                "gh",+                "pr",+                "create",+                "--repo",+                f"{org}/{repo}",+                "--base",+                branch,+                "--title",+                f"[{branch}] dotfiles update needs manual intervention",+                "--body",+                textwrap.dedent(+                    """\+                        Dear maintainer,++                        After updating the dotfiles, `pre-commit run -a`+                        fails in a manner that cannot be resolved automatically.++                        Can you please have a look, fix and merge?++                        Thanks,+                    """+                ),+                "--label",+                "help wanted",+            ]+        )+++@click.command()+@click.argument("branch")+def main(branch):+    for repo in get_repositories():+        if repo not in ("event",):+            continue+        try:+            with temporary_clone(repo, branch):+                print("=" * 10, repo, "=" * 10)+                # set git user/email+                subprocess.check_call(+                    ["git", "config", "user.name", "oca-git-bot"],+                )+                subprocess.check_call(+                    ["git", "config", "user.email", "oca-git-bot@odoo-community.org"],+                )

This might not be the best if you're running locally. Maybe you can just add --author='oca-git-bot <oca-git-bot@odoo-community.org>' to git commit?

sbidoul

comment created time in a month

PR opened OCA/maintainer-tools

Copier update sbi

This is the script I currently use to update dotfiles. I post it here in draft state case anyone is interested.

Needs thinking:

  • This should probably be a bot action
  • It runs pre-commit locally. If ok, it pushes to the main branch with [ci skip]. If not it creates a PR (example). This is a shortcut to save CI build time, but in the general case, a dotfiles update could break something else than pre-commit. So it might be best to always create a PR and immediately ocabot merge it. The drawback is that it will create a ci build storm...
+128 -0

0 comment

2 changed files

pr created time in a month

pull request commentOCA/maintainer-tools

Change docutils version and move to GitHub actions

@sbidoul ETA "is as soon as I can" :) https://github.com/OCA/oca-addons-repo-template/pull/44#issuecomment-743046947

sbidoul

comment created time in a month

pull request commentOCA/maintainer-tools

Change docutils version and move to GitHub actions

Do we have an ETA for deployment? Thanks!

sbidoul

comment created time in a month

issue closedOCA/maintainer-tools

ERROR: Requested docutils<0.15.1.1,>=0.15.1 (from oca-maintainers-tools==0.1.dev998+g1b5c7ad) has different version in metadata: '0.15.1'

Help, I see 14.0 build failing because of oca-maintainers-tools. Example: https://travis-ci.com/github/OCA/account-analytic/jobs/457559449#L299

closed time in a month

dreispt

issue openedOCA/maintainer-tools

ERROR: Requested docutils<0.15.1.1,>=0.15.1 (from oca-maintainers-tools==0.1.dev998+g1b5c7ad) has different version in metadata: '0.15.1'

Help, I see 14.0 build failing because of oca-maintainers-tools. Example: https://travis-ci.com/github/OCA/account-analytic/jobs/457559449#L299

created time in a month

push eventOCA/odoo-community.org

Jairo Llopis

commit sha 2abd3dbd679b788dbd9a422974173341cc65ac68

Clarify that using printf formatting is for security See https://github.com/OCA/pylint-odoo/issues/302.

view details

Stéphane Bidoul

commit sha 33fc920e2303db6987415f03d5b6ab167078bf1f

Merge pull request #58 from Tecnativa/percent-security Clarify that using printf formatting is for security

view details

push time in a month

PR merged OCA/odoo-community.org

Clarify that using printf formatting is for security

See https://github.com/OCA/pylint-odoo/issues/302.

+2 -1

3 comments

1 changed file

Yajo

pr closed time in a month

pull request commentOCA/odoo-community.org

Clarify that using printf formatting is for security

Could you give me permissions to merge in this project, please?

Hi @moylop260 currently only board has access to this repo, probably because it is (was?) the OCA website. We can open the discussion on who should be added, but in the meantime, just @ mention me and I'll review and merge.

Yajo

comment created time in a month

Pull request review commentOCA/odoo-community.org

Clarify that using printf formatting is for security

 Idioms * For Python 3 (Odoo >= 11.0), no need for utf-8 coding line as this is   implicit. * Prefer `%` over `.format()`, prefer `%(varname)` instead of positional.-  This is better for translation and clarity.+  This is better for translation and security.

It would be nice to have a link to some source that explains why it is a security issue.

Yajo

comment created time in a month

pull request commentOCA/odoo-community.org

Clarify that using printf formatting is for security

@sbidoul @gurneyalex

Could you give me permissions to merge in this project, please?

Yajo

comment created time in a month

pull request commentOCA/odoo-community.org

Clarify that using printf formatting is for security

FYI @moylop260

Yajo

comment created time in a month

pull request commentOCA/maintainer-tools

Change docutils version and move to GitHub actions

Let's share the duty between CIs! Thanks for all the hard work.

sbidoul

comment created time in a month

pull request commentOCA/maintainer-tools

Change docutils version and move to GitHub actions

aaand... this repo is now travis-free. 199 to go.

sbidoul

comment created time in a month

push eventOCA/maintainer-tools

Stéphane Bidoul

commit sha ab1d7f6f8c53d338d727d184edbff3511dde4b74

Change docutils version docutils 0.15.1-post1 has installation issues with pip. see https://github.com/pypa/pip/issues/9203#issuecomment-740718379

view details

Stéphane Bidoul

commit sha 1b9a5ad127936be8c7bf4a54c6f83cac33bf242d

Use GitHub actions instead of travis

view details

Stéphane Bidoul

commit sha b9c963d5fc455d7bf2524d4db20c2b34078af4a5

Merge pull request #483 from acsone/fix-docutil-pip-issue Change docutils version and move to GitHub actions

view details

push time in a month

more