Skip to content

refactor: simplify workflow file loading#6017

Open
nikpivkin wants to merge 1 commit intonektos:masterfrom
nikpivkin:workflow-loading
Open

refactor: simplify workflow file loading#6017
nikpivkin wants to merge 1 commit intonektos:masterfrom
nikpivkin:workflow-loading

Conversation

@nikpivkin
Copy link

Simplified the workflow file loading logic.

  • Replaced filepath.Walk with filepath.WalkDir since it was introduced in Go 1.16 and is more efficient, also returning fs.DirEntry without extra fs.FileInfo conversion.
  • Renamed WorkflowFiles to WorkflowFile because the structure represents a single file rather than a collection.
  • File traversal is now uniform — filepath.WalkDir is used regardless of whether the path is a file or a directory.
  • Recursive traversal logic is handled inside the walk function instead of using separate processing via os.ReadDir.

Signed-off-by: Nikita Pivkin <nikita.pivkin@smartforce.io>
@nikpivkin nikpivkin marked this pull request as ready for review March 6, 2026 10:18
@mergify mergify bot added the needs-work Extra attention is needed label Mar 6, 2026
@codecov
Copy link

codecov bot commented Mar 6, 2026

Codecov Report

❌ Patch coverage is 95.45455% with 1 line in your changes missing coverage. Please review.
✅ Project coverage is 76.76%. Comparing base (bd4bc99) to head (0bd2949).
⚠️ Report is 35 commits behind head on master.

Files with missing lines Patch % Lines
pkg/model/planner.go 95.45% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##           master    #6017      +/-   ##
==========================================
+ Coverage   74.65%   76.76%   +2.11%     
==========================================
  Files          73       74       +1     
  Lines       11139     9203    -1936     
==========================================
- Hits         8316     7065    -1251     
+ Misses       2186     1503     -683     
+ Partials      637      635       -2     

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

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@nikpivkin
Copy link
Author

It looks like the failed test is not related to changes in the code:

  - Using [grype v0.87.0] https://megalinter.io/8.4.2/descriptors/repository_grype
  - MegaLinter key: [REPOSITORY_GRYPE]
  - Rules config: [.grype.yaml]
  - Command: [grype --config /action/lib/.automation/.grype.yaml dir:.]
  --Error detail:
  [0000]  WARN no explicit name and version provided for directory source, deriving artifact ID from the given path (which is not ideal)
  NAME                           INSTALLED             FIXED-IN  TYPE       VULNERABILITY        SEVERITY 
  @octokit/plugin-paginate-rest  2.21.3                9.2.2     npm        GHSA-h5c3-5r3r-rr8q  Medium    
  @octokit/request               5.6.3                 8.4.1     npm        GHSA-rmvr-2pp2-xj38  Medium    
  @octokit/request-error         2.1.0                 5.1.1     npm        GHSA-xx4v-prfh-6cgc  Medium    
  github.com/docker/cli          v28.4.0+incompatible  29.2.0    go-module  GHSA-p436-gjf2-799p  High
  [0014] ERROR discovered vulnerabilities at or above the severity threshold

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

needs-work Extra attention is needed size/M

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant