Clean up read-only runtime cache trees after tests
Maintainers usually reply within 1 day
Nobody has claimed this yet.
Assessment
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Newbie friendliness
- 68/100
Research direction
Start with the discard_tree() helper in tests/plugin_testing.py to see how it restores write permissions before removal. Then grep the tests for shutil.rmtree calls using ignore_errors=True and switch the temporary runtime cache cleanup to discard_tree(). Done when those tests remove the read-only cache trees without leaving directories behind when run as an unprivileged user.
Written by the indexing model from the issue text.
Description
Proposed Changes
Use the existing discard_tree() helper from tests/plugin_testing.py to clean up temporary runtime cache directories created by tests.
Justification
The runtime cache intentionally makes published revision trees read-only. Several tests use shutil.rmtree() with ignore_errors=True for cleanup, which silently leaves these trees behind when running as an unprivileged user.
Reusing discard_tree() ensures that write permissions are restored before removal and prevents temporary directories from accumulating across repeated test runs.
- Dominant language
- Python
- Stars
- 8
- Forks
- 0
- Avg merge
- 13h 4m
- Merged PRs (30d)
- 77
Getting set up
- No Dockerfile or Docker Compose file
- Has a pull request template
- Read the contributing guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from netbox-community/netbox-scripts
-
app: scripts Bucket: KTLO status: backlog type: housekeeping
Difficulty 2/5 1-3 hours Newbie friendliness 82/100
netbox-community/netbox-scripts#212 ·
Maintainers usually reply within 1 day
-
app: scripts Bucket: KTLO severity: low status: backlog type: bug
Difficulty 2/5 1-3 hours Newbie friendliness 66/100
netbox-community/netbox-scripts#204 ·
Maintainers usually reply within 1 day
-
app: scripts Bucket: Improve status: backlog type: documentation
Difficulty 1/5 1-3 hours Newbie friendliness 78/100
netbox-community/netbox-scripts#200 ·
Maintainers usually reply within 1 day
-
Script result page omits Job-level failure reasonsPossibly taken @pheus claimed this 4 days ago. Openapp: scripts severity: low status: backlog type: bug
Difficulty 2/5 1-3 hours Newbie friendliness 74/100
netbox-community/netbox-scripts#153 · 1 assignee ·
Maintainers usually reply within 1 day
-
Data Source revisions can import native extensions instead of reviewed Python sourcePossibly taken @pheus claimed this 4 days ago. Openapp: scripts severity: low status: backlog type: bug
Difficulty 2/5 1-3 hours Newbie friendliness 76/100
netbox-community/netbox-scripts#146 · 1 assignee ·
Maintainers usually reply within 1 day
All issues in netbox-community/netbox-scripts
Similar issues
-
Difficulty 2/5 1-3 hours Newbie friendliness 64/100
-
ApacheTomcatImporterPipeline truncates milestone fixed versions (e.g. 11.0.0-M6 -> 11.0.0)Possibly taken @nikolya-ctrl claimed this today. Open
Difficulty 2/5 1-3 hours Newbie friendliness 85/100
aboutcode-org/vulnerablecode#2533 ·
Maintainers usually reply within 5 days
-
Difficulty 2/5 1-3 hours Newbie friendliness 62/100
PermafrostDiscoveryGateway/water-timeseries-v2#312 ·
Maintainers usually reply within 1 day
-
bug
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
ClickHouse/dbt-clickhouse#829 ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 76/100
Maintainers usually reply within 1 day