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

fix(scanner): use individual store for loadConfigItemList #248

Merged
merged 1 commit into from
May 23, 2023

Conversation

noahziheng
Copy link
Member

scanner/utils 中的 loadConfigItemList 方法用于在扫描每个 Ref 时加载其内部的配置,为了保证函数类型配置工作正常,此前复用了 app,但此前仅在扫描任务完全结束时清理了一次 ConfigStore,所以可能在某些 ref 中拿到被不正常合并后的配置,造成加载异常。

本 PR 调整项包括:

  • loadConfigItemList 调整实现
    • 通过在 async 过程中替换 configStore 指向,确保每次调用该方法时使用一干净的 Store,调用结束前还原
  • 移除已无必要的清理逻辑,减少误解
  • 移除已无调用的 getAllConfig 方法,减少误解

@noahziheng noahziheng self-assigned this May 23, 2023
@noahziheng noahziheng added the bug Something isn't working label May 23, 2023
@noahziheng noahziheng changed the title fix(scanner): use individual store for config store fix(scanner): use individual store for loadConfigItemList May 23, 2023
@codecov-commenter
Copy link

codecov-commenter commented May 23, 2023

Codecov Report

Patch coverage: 100.00% and project coverage change: -0.01 ⚠️

Comparison is base (4688317) 91.72% compared to head (7cce44b) 91.71%.

❗ Your organization is not using the GitHub App Integration. As a result you may experience degraded service beginning May 15th. Please install the Github App Integration for your organization. Read more.

Additional details and impacted files
@@            Coverage Diff             @@
##           master     #248      +/-   ##
==========================================
- Coverage   91.72%   91.71%   -0.01%     
==========================================
  Files          49       49              
  Lines        1196     1195       -1     
  Branches      214      212       -2     
==========================================
- Hits         1097     1096       -1     
  Misses         99       99              
Impacted Files Coverage Δ
src/configuration/index.ts 70.58% <ø> (-3.10%) ⬇️
src/scanner/task.ts 95.38% <ø> (-0.04%) ⬇️
src/scanner/utils.ts 100.00% <100.00%> (ø)

☔ View full report in Codecov by Sentry.
📢 Do you have feedback about the report comment? Let us know in this issue.

@noahziheng noahziheng merged commit 0ae9170 into master May 23, 2023
@noahziheng noahziheng deleted the fix/config-items-list-state branch May 23, 2023 11:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants