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

refactor(reverse): dockerfilefromhistory default processor #472

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

Commits on Feb 6, 2023

  1. Extracts processRawInst from DockerfileFromHistory

    In order to test and refactor the default case for the raw
    instruction processor, this change identify the values affected
    (`inst`and `isExecForm`), and extracts the case body out to
    a new function.
    
    Signed-off-by: Dennis Walters <[email protected]>
    ess committed Feb 6, 2023
    Configuration menu
    Copy the full SHA
    a07aca9 View commit details
    Browse the repository at this point in the history
  2. Tests processRawInst

    Added unit tests for the function that was previously extracted
    from `DockerfileFromHistory` to ensure refactored behavior.
    
    Signed-off-by: Dennis Walters <[email protected]>
    ess committed Feb 6, 2023
    Configuration menu
    Copy the full SHA
    36fef49 View commit details
    Browse the repository at this point in the history
  3. Refactors processRawInst

    * Extracts `processAsUncaughtInst` for handling standard
      instructions that were given in a non-standard form (as
      may happen with buildkit, etc)
    * Extracts `processAsArgsFormat` for handling RUN instructions
      that were provided in the args format
    * Extracts `processAsExecRun` for handling commands that were
      provided in a non-standard way
    * Extracts `detectRawShellForm` for detecting commands that
      are shaped like shell form RUN instructions
    * Extracts `execify` for converting arrays of strings to
      exec format RUN instructions (and lowering code duplication)
    * Replaces the body of `processRawInst` to incorporate these
      extracted functions and generally make the problem easier
      to reason about and extend
    
    Signed-off-by: Dennis Walters <[email protected]>
    ess committed Feb 6, 2023
    Configuration menu
    Copy the full SHA
    b0fc8b5 View commit details
    Browse the repository at this point in the history
  4. Removed testing artifacts

    Signed-off-by: Dennis Walters <[email protected]>
    ess committed Feb 6, 2023
    Configuration menu
    Copy the full SHA
    133d5fb View commit details
    Browse the repository at this point in the history
  5. More testing artifacts

    Signed-off-by: Dennis Walters <[email protected]>
    ess committed Feb 6, 2023
    Configuration menu
    Copy the full SHA
    4a4ebcd View commit details
    Browse the repository at this point in the history