Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: Narrow scope of cleanup #8441

Merged
merged 1 commit into from
Nov 7, 2024
Merged

fix: Narrow scope of cleanup #8441

merged 1 commit into from
Nov 7, 2024

Conversation

matmair
Copy link
Member

@matmair matmair commented Nov 6, 2024

This fixes the clear-generated task. It was previously too widely scoped and had the potential to brick users envs if they were under /opt/inventree (which is the default).
This fix narrows the scope to the "src" directory - which is always guaranteed to be InvenTree internal stuff.

Fixes #8252 #8155

@matmair matmair added bug Identifies a bug which needs to be addressed setup Relates to the InvenTree setup / installation process labels Nov 6, 2024
@matmair matmair added this to the 0.17.0 milestone Nov 6, 2024
@matmair matmair self-assigned this Nov 6, 2024
Copy link

netlify bot commented Nov 6, 2024

Deploy Preview for inventree-web-pui-preview canceled.

Name Link
🔨 Latest commit e7d4711
🔍 Latest deploy log https://app.netlify.com/sites/inventree-web-pui-preview/deploys/672bf5ee3643f500083c37e8

@SchrodingersGat
Copy link
Member

What happens if the invoke task is run from outside the source directory? Should we also confirm that the command is being run from the correct directory first?

@matmair
Copy link
Member Author

matmair commented Nov 6, 2024

that should not be a problem, the command uses the run wrapper that ensures that all commands are run from the root of the install

@matmair
Copy link
Member Author

matmair commented Nov 6, 2024

See

InvenTree/tasks.py

Lines 139 to 150 in c062d5e

def run(c, cmd, path: Optional[Path] = None, pty=False, env=None):
"""Runs a given command a given path.
Args:
c: Command line context.
cmd: Command to run.
path: Path to run the command in.
pty (bool, optional): Run an interactive session. Defaults to False.
"""
env = env or {}
path = path or localDir()
c.run(f'cd "{path}" && {cmd}', pty=pty, env=env)

@SchrodingersGat SchrodingersGat added backport Apply this label to a PR to enable auto-backport action backport-to-0.16.x labels Nov 6, 2024
@SchrodingersGat SchrodingersGat merged commit fade7e3 into master Nov 7, 2024
40 checks passed
@SchrodingersGat SchrodingersGat deleted the fix-cleanup-task branch November 7, 2024 00:20
Copy link
Contributor

github-actions bot commented Nov 7, 2024

💔 All backports failed

Status Branch Result
0.16.x Backport failed because of merge conflicts

Manual backport

To create the backport manually run:

backport --pr 8441

Questions ?

Please refer to the Backport tool documentation and see the Github Action logs for details

SchrodingersGat pushed a commit to SchrodingersGat/InvenTree that referenced this pull request Nov 7, 2024
SchrodingersGat added a commit that referenced this pull request Nov 7, 2024
Co-authored-by: Matthias Mair <code@mjmair.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backport Apply this label to a PR to enable auto-backport action backport-to-0.16.x bug Identifies a bug which needs to be addressed setup Relates to the InvenTree setup / installation process
Projects
None yet
Development

Successfully merging this pull request may close these issues.

502 Bad Gateway after upgrade 0.16.1 -> 0.16.5 / OSError: No translation files found
2 participants