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

DAOS-623 ci: avoid exception in extra.py when clang-format is missing #15762

Open
wants to merge 3 commits into
base: master
Choose a base branch
from

Conversation

grom72
Copy link
Contributor

@grom72 grom72 commented Jan 22, 2025

To avoid extra.py script corruption when clang-format is not installed.

Traceback (most recent call last):
  File "/home/grom72/repos/daos/./site_scons/site_tools/extra/extra.py", line 141, in <module>
    main()
  File "/home/grom72/repos/daos/./site_scons/site_tools/extra/extra.py", line 105, in main
    supported = _supports_correct_style(WhereIs('clang-format'))
  File "/home/grom72/repos/daos/./site_scons/site_tools/extra/extra.py", line 51, in _supports_correct_style
    rawbytes = subprocess.check_output([clang_exe, "-version"])
  File "/usr/lib64/python3.9/subprocess.py", line 424, in check_output
    return run(*popenargs, stdout=PIPE, timeout=timeout, check=True,
  File "/usr/lib64/python3.9/subprocess.py", line 505, in run
    with Popen(*popenargs, **kwargs) as process:
  File "/usr/lib64/python3.9/subprocess.py", line 951, in __init__
    self._execute_child(args, executable, preexec_fn, close_fds,
  File "/usr/lib64/python3.9/subprocess.py", line 1712, in _execute_child
    and os.path.dirname(executable)
  File "/usr/lib64/python3.9/posixpath.py", line 152, in dirname
    p = os.fspath(p)
TypeError: expected str, bytes or os.PathLike object, not NoneType

Doc-only: true

Before requesting gatekeeper:

  • Two review approvals and any prior change requests have been resolved.
  • Testing is complete and all tests passed or there is a reason documented in the PR why it should be force landed and forced-landing tag is set.
  • Features: (or Test-tag*) commit pragma was used or there is a reason documented that there are no appropriate tags for this PR.
  • Commit messages follows the guidelines outlined here.
  • Any tests skipped by the ticket being addressed have been run and passed in the PR.

Gatekeeper:

  • You are the appropriate gatekeeper to be landing the patch.
  • The PR has 2 reviews by people familiar with the code, including appropriate owners.
  • Githooks were used. If not, request that user install them and check copyright dates.
  • Checkpatch issues are resolved. Pay particular attention to ones that will show up on future PRs.
  • All builds have passed. Check non-required builds for any new compiler warnings.
  • Sufficient testing is done. Check feature pragmas and test tags and that tests skipped for the ticket are run and now pass with the changes.
  • If applicable, the PR has addressed any potential version compatibility issues.
  • Check the target branch. If it is master branch, should the PR go to a feature branch? If it is a release branch, does it have merge approval in the JIRA ticket.
  • Extra checks if forced landing is requested
    • Review comments are sufficiently resolved, particularly by prior reviewers that requested changes.
    • No new NLT or valgrind warnings. Check the classic view.
    • Quick-build or Quick-functional is not used.
  • Fix the commit message upon landing. Check the standard here. Edit it to create a single commit. If necessary, ask submitter for a new summary.

Doc-only: true

Signed-off-by: Tomasz Gromadzki <tomasz.gromadzki@hpe.com>
@grom72 grom72 requested review from a team as code owners January 22, 2025 11:56
Copy link

github-actions bot commented Jan 22, 2025

Ticket title is 'Generic ticket for minor code cleanup and improvement'
Status is 'Resolved'
Labels: 'request_for_2.6.3'
https://daosio.atlassian.net/browse/DAOS-623

Signed-off-by: Tomasz Gromadzki <tomasz.gromadzki@hpe.com>
@daosbuild1
Copy link
Collaborator

Test stage Python Bandit check completed with status FAILURE. https://build.hpdd.intel.com//job/daos-stack/job/daos/view/change-requests/job/PR-15762/2/execution/node/133/log

@grom72 grom72 changed the title DAOS-623 ci: avoid exception in site_scon/..../extra.py when clang-format is missing DAOS-623 ci: avoid exception in extra.py when clang-format is missing Jan 22, 2025
daltonbohning
daltonbohning previously approved these changes Jan 22, 2025
Improve tool user expirience:
- no info message in pre-hook execution
- no "Formatting C files" message if clang-format version is
  invalid

Signed-off-by: Tomasz Gromadzki <tomasz.gromadzki@hpe.com>
@grom72
Copy link
Contributor Author

grom72 commented Jan 23, 2025

@daltonbohning please take a look at one more changes set to improve scripts usability

@grom72 grom72 requested a review from a team January 23, 2025 22:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

4 participants