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(backend): Fix chart generation non-matching blockedHosts #14441

Merged

Conversation

atsu1125
Copy link
Contributor

@atsu1125 atsu1125 commented Aug 19, 2024

What

NOT ILIKE ANY(ARRAY[:...blocked])というのは、blockedリストのいずれかのホスト名やサブドメインに一致しないものを抽出するので、たとえばblockedリストに複数のホスト名があった場合、そのうちの一つにでも一致しなければ結果に含まれてしまいます。
目的は「blockedリストのすべてのホスト名やサブドメインに一致しない場合ものを抽出する」ことでした。これを達成するには、いずれかではなくすべての条件が満たされるようにする必要があります。

たとえばblockedHostsにexample.comが登録されていた場合に
instance.hostにexample.comが存在する場合は、blockedリストの[example.com, %.example.com]のいずれかとマッチしないものを抽出するので、%.example.comにはマッチせずに、結果に含まれます。
instance.hostにa.example.comが存在する場合は、[example.com, %.example.com]のいずれかとマッチしないものを抽出するので、example.comにはマッチせずに、結果に含まれます。
結果的にblockedHostsに含まれるホストはFederationChartの対象から除外できていません。

NOT ILIKE ANY(ARRAY[:...blocked]) extracts hostnames that do not match any hostname or subdomain in the blocked list, so for example, if there are multiple hostnames in the blocked list, if one of them does not match, it will be included in the result.
The goal was to extract those that did not match all hostnames or subdomains in the blocked list. To achieve this, we need to make sure that all conditions are met, not just one.

Why

Fix: #9263

Checklist

  • Read the contribution guide
  • Test working in a local environment
  • (If needed) Add story of storybook
  • (If needed) Update CHANGELOG.md
  • (If possible) Add tests

@github-actions github-actions bot added the packages/backend Server side specific issue/PR label Aug 19, 2024
Copy link
Contributor

このPRによるapi.jsonの差分

差分はこちら

Get diff files from Workflow Page

Copy link

codecov bot commented Aug 19, 2024

Codecov Report

Attention: Patch coverage is 0% with 5 lines in your changes missing coverage. Please review.

Project coverage is 39.86%. Comparing base (59e8360) to head (e3451fe).
Report is 3 commits behind head on develop.

Files Patch % Lines
...ckages/backend/src/core/chart/charts/federation.ts 0.00% 5 Missing ⚠️
Additional details and impacted files
@@             Coverage Diff              @@
##           develop   #14441       +/-   ##
============================================
+ Coverage    20.14%   39.86%   +19.72%     
============================================
  Files          725     1547      +822     
  Lines       100521   190956    +90435     
  Branches      1051     3552     +2501     
============================================
+ Hits         20249    76127    +55878     
- Misses       79729   114237    +34508     
- Partials       543      592       +49     

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

nexryai added a commit to nexryai/altair that referenced this pull request Aug 20, 2024
@syuilo syuilo merged commit 043ab1f into misskey-dev:develop Aug 20, 2024
26 checks passed
@syuilo
Copy link
Member

syuilo commented Aug 20, 2024

🙏🏿

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
packages/backend Server side specific issue/PR
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants