feat: add OUTPUT_FILENAME to customize markdown output#387
feat: add OUTPUT_FILENAME to customize markdown output#387vchrombie wants to merge 8 commits intogithub:mainfrom
Conversation
There was a problem hiding this comment.
Pull request overview
Adds support for customizing the generated markdown report filename via a new OUTPUT_FILENAME environment variable (defaulting to contributors.md).
Changes:
- Added
OUTPUT_FILENAMEparsing (with default) toenv.get_env_vars(). - Wired the configured output filename into
contributors.pywhen writing the markdown report. - Updated tests and README to cover/document the new environment variable.
Reviewed changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
env.py |
Adds OUTPUT_FILENAME env var handling and returns it from get_env_vars(). |
contributors.py |
Uses the returned output_filename when calling markdown.write_to_markdown(). |
test_env.py |
Extends env parsing tests to assert default and custom OUTPUT_FILENAME behavior. |
README.md |
Documents OUTPUT_FILENAME and updates job summary wording to be filename-agnostic. |
30cb19a to
d4ff051
Compare
|
@vchrombie this looks great. I've got one documentation suggestion to help folks understand the default exists. Thanks for your PR!! |
|
Thanks @zkoppert for the suggestion. |
d5a635a to
cbb09ac
Compare
|
I rebased the branch with the latest changes @zkoppert, could you please approve it to kick the ci checks? |
c21a904 to
b226a02
Compare
|
I can rebase the latest changes |
Expose OUTPUT_FILENAME env var with default contributors.md, wire into markdown output, and document/test it. Signed-off-by: Venu Vardhan Reddy Tekula <venuvrtekula@gmail.com>
Use a job-level OUTPUT_FILENAME and reference it in content-filepath so examples stay in sync. Signed-off-by: Venu Vardhan Reddy Tekula <venuvrtekula@gmail.com>
Co-authored-by: Zack Koppert <zkoppert@github.com> Signed-off-by: Venu Vardhan Reddy Tekula <venuvrtekula@gmail.com>
644bf5e to
ea7eb40
Compare
|
I rebased this too, let's take one pr at a time. I can rebase the other ones as needed. |
- Add missing _output_filename to tuple unpacking in test_get_env_vars_valid_date_range - Fix test_get_env_vars_missing_org_or_repo to use clear=True and test=True so local .env files don't interfere Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
|
Pushed a fix for the CI failure and an additional test robustness improvement:
Will watch CI for any further failures to help get this moving through. 👀 |
Add the 13th return value ('contributors.md') to all mocked get_env_vars
tuples so tests match the updated function signature.
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
|
Merged
All 52 tests pass locally with 100% coverage. Watching CI for this run. 👀 |
…aracters Reject filenames containing path separators, special characters, or absolute paths. Only alphanumeric characters, hyphens, underscores, and dots are allowed. Adds four security tests covering path traversal, absolute paths, directory separators, and shell metacharacters. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
|
Added input validation for Problem: The filename was accepted as-is after stripping whitespace, which meant path traversal ( Fix: Added a regex check ( |
zkoppert
left a comment
There was a problem hiding this comment.
Thanks for coming along the wild ride to get that in @vchrombie ! Appreciate your contributions! 🚀
|
This is ready to go now. I just need to figure out why codeql hasn't reported like it should. Hang in there... I'll investigate |
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Fixes #18
Expose OUTPUT_FILENAME env var with default contributors.md, wire into markdown output, and document/test it.
Pull Request
Proposed Changes
Readiness Checklist
Author/Contributor
make lintand fix any issues that you have introducedmake testand ensure you have test coverage for the lines you are introducing@jeffrey-luszczReviewer
bug,documentation,enhancement,infrastructure,maintenanceorbreaking