Skip to content

Add config file validation#1037

Draft
aor7000 wants to merge 7 commits into
mainfrom
638-validate-config
Draft

Add config file validation#1037
aor7000 wants to merge 7 commits into
mainfrom
638-validate-config

Conversation

@aor7000

@aor7000 aor7000 commented May 26, 2026

Copy link
Copy Markdown
Collaborator

🗣 Description

💭 Motivation and context

Closes #638

🧪 Testing

✅ Pre-approval checklist

  • This PR has an informative and human-readable title.
  • Changes are limited to a single goal - eschew scope creep!
  • If applicable, All future TODOs are captured in issues, which are referenced in the PR description.
  • The relevant issues PR resolves are linked preferably via closing keywords.
  • All relevant type-of-change labels have been added.
  • I have read and agree to the CONTRIBUTING.md document.
  • These code changes follow cisagov code standards.
  • All relevant repo and/or project documentation has been updated to reflect the changes in this PR.
  • Tests have been added and/or modified to cover the changes in this PR.
  • All new and existing tests pass.

✅ Pre-merge Checklist

  • This PR has been smoke tested to ensure main is in a functional state when this PR is merged.
  • Squash all commits into one PR level commit using the Squash and merge button.

✅ Post-merge Checklist

  • Delete the branch to clean up.
  • Close issues resolved by this PR if the closing keywords did not activate.

@aor7000
aor7000 requested review from adhilto and rlxdev May 26, 2026 15:38
@aor7000 aor7000 self-assigned this May 26, 2026
@aor7000 aor7000 linked an issue May 26, 2026 that may be closed by this pull request
@aor7000 aor7000 changed the title fix error reading config file and num_uuid Issues reading config file and num_uuid May 26, 2026
@FollyBeachGurl FollyBeachGurl added this to the Isle milestone May 26, 2026
@adhilto adhilto changed the title Issues reading config file and num_uuid Add config file validation May 27, 2026

@adhilto adhilto 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.

This fixes the validation of the numberofuuidcharacterstotruncate, but there is more validation that still needs to be done. Take another look at my comment on the original issue for more details: #638 (comment). The other examples I described in that issue still produce errors.

To recap, we need the following validation:

Look through the get_gws_args function inside of main.py to see where we define our arguments. For each argument we define there:

  • If we specify a non-string type (e.g., int), the config file parser should make throw an error if the user provides an argument of the wrong type.
  • If we specify choices, the config file parser should throw an error if the user puts in an invalid choice.
  • If we specify nargs='+', the config file parser should throw an error if the user provides something other than a list

snarve and others added 6 commits June 1, 2026 09:50
* [#266] Update the utils function and reports

* Remove commented code

* Update missed test
Co-authored-by: GitHub Action <action@github.com>
Pins the default GITHUB_TOKEN to contents: read on workflows that don't
call a GitHub API beyond the initial checkout. Other workflows that need
write scopes are left implicit for a maintainer to declare.

Motivation: CVE-2025-30066 (March 2025 tj-actions/changed-files
compromise) exfiltrated GITHUB_TOKEN from workflow logs. Per-workflow
caps bound runtime authority irrespective of repo or org default,
give drift protection, and are credited per-file by the OpenSSF
Scorecard Token-Permissions check.

YAML validated locally with yaml.safe_load.

Signed-off-by: Arpit Jain <arpitjain099@gmail.com>
Co-authored-by: dagarwal-ecs <devesh.agarwal@ecstech.com>
Three workflows were missing explicit permissions blocks, causing them
to inherit the repository default token permissions — broader than
needed. Each of these workflows only reads the repository, so
contents: read is sufficient.

Affected workflows:
- pylint.yml
- run_link_checker_for_md_edits.yml
- run_opa_tests.yml

This is flagged by OpenSSF Scorecard under Token-Permissions and
extends the fix from #1048 which addressed run_link_checker_cron_job.yml.
@adhilto

adhilto commented Jun 16, 2026

Copy link
Copy Markdown
Collaborator

This fixes the validation of the numberofuuidcharacterstotruncate, but there is more validation that still needs to be done. Take another look at my comment on the original issue for more details: #638 (comment). The other examples I described in that issue still produce errors.

To recap, we need the following validation:

Look through the get_gws_args function inside of main.py to see where we define our arguments. For each argument we define there:

  • If we specify a non-string type (e.g., int), the config file parser should make throw an error if the user provides an argument of the wrong type.
  • If we specify choices, the config file parser should throw an error if the user puts in an invalid choice.
  • If we specify nargs='+', the config file parser should throw an error if the user provides something other than a list

@aor7000 this comment still needs to be addressed, let me know if you have any questions.

@FollyBeachGurl FollyBeachGurl modified the milestones: Isle, JAWS Jun 30, 2026
@aor7000 aor7000 assigned cristina479 and unassigned aor7000 Jul 13, 2026
@FollyBeachGurl
FollyBeachGurl marked this pull request as draft July 22, 2026 19:30
@FollyBeachGurl

Copy link
Copy Markdown
Collaborator

@cristina479 I moved this back to draft while we wait for you to update this PR with Alden's changes.

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.

Validate the parameters passed into the Scuba config file

7 participants