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

NXDRIVE- : Fix alpha cleaup pipeline issue #4842

Closed
Closed
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
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions .github/workflows/alpha_cleanup.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,9 @@ on:
# Check for updates every day
schedule:
- cron: "0 0 * * *"
pull_request:
paths:
- "tools/cleanup.txt"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

suggestion (performance): Consider specifying types of pull request events.

It's good to specify paths for pull request triggers, but consider also specifying types of pull request activities (like 'opened', 'synchronize', etc.) to avoid unnecessary runs.

Suggested change
pull_request:
paths:
- "tools/cleanup.txt"
pull_request:
types: [opened, synchronize, reopened]
paths:
- "tools/cleanup.txt"


# Allow to clean-up a specific version
workflow_dispatch:
Expand Down
2 changes: 1 addition & 1 deletion tools/cleanup.sh
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ main() {
python3 -m pip install --user -U setuptools wheel
python3 -m pip install --user pyyaml==5.3.1

echo ">>> Retrieving versions.yml"
echo ">>> Retrieving versions.yml, yml path: ${REMOTE_PATH_PROD}/versions.yml"
rsync -e "ssh -o StrictHostKeyChecking=no" -vz nuxeo@lethe.nuxeo.com:"${REMOTE_PATH_PROD}/versions.yml" .

echo ">>> Checking versions.yml integrity"
Expand Down
2 changes: 2 additions & 0 deletions tools/versions.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,8 @@

def _load():
"""Get initial versions."""
print(f">>> Pwd: {os.getcwd()}")
print(f">>>>> list dir: {os.listdir(os.getcwd())}")
Comment on lines +21 to +22
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

suggestion (code_refinement): Debugging statements should be conditional or removed.

Printing the current working directory and its contents can be useful for debugging but might clutter the output in production. Consider making these conditional based on a debug flag or removing them after use.

Suggested change
print(f">>> Pwd: {os.getcwd()}")
print(f">>>>> list dir: {os.listdir(os.getcwd())}")
import os
def _load():
"""Get initial versions."""
if os.getenv('DEBUG', 'False').lower() in ['true', '1', 't']:
print(f">>> Pwd: {os.getcwd()}")
print(f">>>>> list dir: {os.listdir(os.getcwd())}")


with open("versions.yml", encoding="utf-8") as yml:
return yaml.safe_load(yml.read()) or {}
Expand Down