Skip to content

CONTRIBUTING: name the two shared output helpers, tools/file_mode.py and tools/report_paths.py (EGEN-CONTRIB-HELPERS) - #6562

Open
evilclanker9000 wants to merge 2 commits into
ItsNotRexed:mainfrom
evilclanker9000:deepseek/9-contrib-helpers
Open

evilclanker9000 wants to merge 2 commits into
ItsNotRexed:mainfrom
evilclanker9000:deepseek/9-contrib-helpers

Conversation

@evilclanker9000

Copy link
Copy Markdown
Contributor

CONTRIBUTING.md's "Working on the code" tells a writer how to write a text report, but not how to publish it: neither of the two shared helpers every report writer already imports is named anywhere in the repository's docs.

This adds two bullets after the line-ending one:

Tests

No GPU needed; a docs change.

python -I tests/test_docs_list_items.py     ok 0
python -I tests/test_docs_repeated_lines.py ok 0
python -I tests/test_docs_python_deps.py    ok 0
python -I tests/test_docs_links.py          ok 0
python -I tests/test_docs_env_vars.py       ok 0

Both named helpers were run to confirm the wording:

python -I -c "import sys,os,tempfile;sys.path.insert(0,os.path.abspath('tools'))
from file_mode import published_mode,new_file_mode
from report_paths import same_report_path
d=tempfile.mkdtemp(); p=os.path.join(d,'r.json')
print('new_file_mode',oct(new_file_mode(d)),'published(new)',oct(published_mode(p)))
print('same ctorped',same_report_path(p,os.path.join(d,'R.JSON')),'different',same_report_path(p,os.path.join(d,'x.json')))"
new_file_mode 0o666 published(new) 0o666
same ctorped True different False

Notes

  • I put this in CONTRIBUTING.md rather than a docs/ page because the rule it belongs next to (how a tool writes its report) is already there, and tools/file_mode.py is a rule for contributors writing new tools, not a measured format.
  • The two bullets are separate commits, one helper each, so either could be dropped without disturbing the other.
  • The check above runs on Windows, where os.chmod cannot express 0640, so it only shows the functions exist and agree on the case-folded name; the POSIX permission behaviour is the helper's own docstring and tests/test_file_mode.py.

AI-assisted.

@shayderrr shayderrr left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Summary: CONTRIBUTING.md adds two contributor rules: published reports take destination permissions from tools/file_mode.py:published_mode with os.replace rather than toggling os.umask, and --out paths that alias an input, another report or a tool index are refused with same_report_path from tools/report_paths.py, which also catches case-folding, hard links and Unicode normalization.

Why merge: Documents two cross-platform path and permission conventions that prevent process-wide umask races and accidental report clobbering. Docs only.

Verdict: Approve

@shayderrr

Copy link
Copy Markdown
Collaborator

Summary: CONTRIBUTING.md adds two contributor rules: published reports take destination permissions from tools/file_mode.py:published_mode with os.replace rather than toggling os.umask, and --out paths that alias an input, another report or a tool index are refused with same_report_path from tools/report_paths.py, which also catches case-folding, hard links and Unicode normalization.

Why merge: Documents two cross-platform path and permission conventions that prevent process-wide umask races and accidental report clobbering. Docs only.

Verdict: Approve

@cryptocxeq cryptocxeq left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Independent documentation/source review at e361b4d3d594fc880caad518e7a9ef4162ac12bd against main 32a50c949e882ae539f2d54be93fadd50ce76cae. Review claim.

The proposed helper names and behavior agree with current source: file_mode.published_mode preserves an existing destination's bits or probes new-file mode without toggling process-wide umask; callers must apply those bits to the staging file before os.replace. report_paths.same_report_path handles resolved aliases/hard links and the volume-sensitive name cases described. The current CONTRIBUTING.md already documents report_paths.same_report_path at lines 34-37, which explains part of the context drift. The patch does not apply directly; please rebase and retain one path-helper explanation while adding any still-missing staging-permission guidance. I read the proposed file at the PR head and checked the helper definitions and an existing chmod/publish call site; no new code or permission behavior was exercised.

Public repository source and primary tool documentation only; no game files, keys, game services or hardware validation. COMMENT review, not a merge approval.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants