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

EccCheck update to later tools. Change EccCheck plugin scope. Add EccCheck #770

Closed

Conversation

apop5
Copy link
Contributor

@apop5 apop5 commented Mar 14, 2024

Description

EccCheck is a tool that verifies additional Efi Code Compatibility for files that have been modified.

EccCheck relies on the basetool/Source/Python/Ecc.
Ecc contained files that were generated for parsing C files, but these were tied antlr4-runtime 4.7.1.

Documented instructions for generating new Ecc parser files/

For each item, place an "x" in between [ and ] if true. Example: [x].
(you can also check items in the GitHub UI)

  • Impacts functionality?
    • Functionality - Does the change ultimately impact how firmware functions?
    • Examples: Add a new library, publish a new PPI, update an algorithm, ...
  • Impacts security?
    • Security - Does the change have a direct security impact on an application,
      flow, or firmware?
    • Examples: Crypto algorithm change, buffer overflow fix, parameter
      validation improvement, ...
  • Breaking change?
    • Breaking change - Will anyone consuming this change experience a break
      in build or boot behavior?
    • Examples: Add a new library class, move a module to a different repo, call
      a function in a new library class in a pre-existing module, ...
  • Includes tests?
    • Tests - Does the change include any explicit test code?
    • Examples: Unit tests, integration tests, robot tests, ...
  • Includes documentation?
    • Documentation - Does the change contain explicit documentation additions
      outside direct code modifications (and comments)?
    • Examples: Update readme file, add feature readme file, link to documentation
      on an a separate Web page, ...

How This Was Tested

Ran tests locally on repo after adding scope cibuild-edk2
Modified different files within packages to see if CI error would be tripped.

Integration Instructions

If wanting to use the EccCheck plugin, add cibuild-edk2 to the scope of the build files.

… readme file with instructions for regenerating for future reference
@github-actions github-actions bot added language:python Pull requests that update Python code impact:non-functional Does not have a functional impact labels Mar 14, 2024
@codecov-commenter
Copy link

codecov-commenter commented Mar 14, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 1.23%. Comparing base (09be074) to head (3452c51).
Report is 1 commits behind head on release/202311.

Additional details and impacted files
@@               Coverage Diff               @@
##           release/202311     #770   +/-   ##
===============================================
  Coverage            1.23%    1.23%           
===============================================
  Files                1302     1302           
  Lines              332084   332084           
  Branches             6683     6683           
===============================================
  Hits                 4117     4117           
  Misses             327891   327891           
  Partials               76       76           
Flag Coverage Δ
MdeModulePkg 0.69% <ø> (ø)
MdePkg 5.37% <ø> (ø)
NetworkPkg 0.00% <ø> (ø)
PolicyServicePkg 30.41% <ø> (ø)
UnitTestFrameworkPkg ∅ <ø> (∅)

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@apop5 apop5 requested a review from Javagedes March 14, 2024 23:42
# Run git command to determine repos default branch
#
result = StringIO()
params = "symbolic-ref refs/remotes/origin/HEAD --short"
Copy link
Contributor

Choose a reason for hiding this comment

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

I agree the current way of hardcoding to origin/master is bad for us, but I think this way will also cause issues if we are targeting the non-default branch on CI. Such as cherry-picking changes back or if you have a PR targeting a feature branch.

Copy link
Contributor Author

@apop5 apop5 Mar 15, 2024

Choose a reason for hiding this comment

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

I agree that this tool is not optimal. Thankfully, this is not being enabled as part of CI, its scope is just being changed to cibuild-edk2 to enable mu based projects to be able to run the edk2 tool locally.

Comparing against the default branch may seem problematic, but the way the tool works is it uses the lines changed between the default branch and the current branch and filters the ecc check log to only report the errors corresponding to the changed lines. This means that the tool will only ever check a subset of the entire files for errors, and that a lot of things which do not conform to the coding standards will be able to slip through repeatedly until someone changes something in those lines.

As for cherry-picking changes, our most common cherry-pick source is from upstream, which runs this tool as part of their CI process. So cherry-picking most change from upstream should, for the most part, already have passed this check.

Copy link
Member

@makubacki makubacki Mar 15, 2024

Choose a reason for hiding this comment

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

I think Joey's saying that we often work on non-default branches. For example, release/202311 (default) and release/202302. In that case, cherry-picking into release/202302 will have the files compared to their equivalents in release/202311 which might be in a different base state which would result in an invalid delta.

The patchset only diff is okay I think but it needs to be correct.

Copy link

This PR has been automatically marked as stale because it has not had activity in 60 days. It will be closed if no further activity occurs within 7 days. Thank you for your contributions.

@github-actions github-actions bot added the state:stale Has not been updated in a long time label May 14, 2024
Copy link

This pull request has been automatically been closed because it did not have any activity in 60 days and no follow up within 7 days after being marked stale. Thank you for your contributions.

@github-actions github-actions bot closed this May 22, 2024
This pull request was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
impact:non-functional Does not have a functional impact language:python Pull requests that update Python code state:stale Has not been updated in a long time
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants