Skip to content

Create datadog-synthetics.yml - #144

Closed
danialzivehdadr wants to merge 3 commits into
react-component:mainfrom
danialzivehdadr:main
Closed

Create datadog-synthetics.yml#144
danialzivehdadr wants to merge 3 commits into
react-component:mainfrom
danialzivehdadr:main

Conversation

@danialzivehdadr

@danialzivehdadr danialzivehdadr commented Jun 19, 2026

Copy link
Copy Markdown

Pick folder

Summary by CodeRabbit

  • Tests
    • main 分支的提交与拉取请求中自动触发 Datadog Synthetics 测试,执行 e2e-tests 标签用例,并通过密钥完成鉴权。
  • Chores
    • 新增工作流步骤:先获取示例文件,再调用 Document Force 解析接口处理文件内容;同时配置了结果等待策略与展示元信息。

Signed-off-by: danialzivehdar <243804543+danialzivehdar1992-hue@users.noreply.github.com>
@gemini-code-assist

Copy link
Copy Markdown

Note

Gemini is unable to generate a review for this pull request due to the file types involved not being currently supported.

@coderabbitai

coderabbitai Bot commented Jun 19, 2026

Copy link
Copy Markdown

Review Change Stack

Warning

Review limit reached

@danialzivehdadr, we couldn't start this review because you've reached your PR review rate limit.

More reviews will be available in 56 minutes and 48 seconds. Learn how PR review limits work.

Your organization has used up its prepaid credits, and credit purchases are no longer available. Enable the review add-on in the billing tab to keep reviews running — you're only billed for reviews past your plan's rate limits ($0.25/file).

⌛ How to resolve this issue?

After more reviews become available, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based credits.

🚦 How do rate limits work?

CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability.

For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window.

Please see our Fair Usage Limits Policy for further information.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: e3d82967-1178-4250-8e38-aac3d63f781c

📥 Commits

Reviewing files that changed from the base of the PR and between b95cb02 and 92c1ade.

📒 Files selected for processing (1)
  • dimension

Walkthrough

新增一个 Datadog Synthetics GitHub Actions 工作流,并新增一个“获取文件 → 文档解析”的工作流步骤链。

Changes

Datadog Synthetics 工作流接入

Layer / File(s) Summary
Datadog Synthetics 工作流定义
.github/workflows/datadog-synthetics.yml
新增完整工作流:在 main 分支的 push/pull_request 触发,执行 actions/checkout@v4 后调用 DataDog/synthetics-ci-github-action,并通过 secrets 传入 DD_API_KEYDD_APP_KEY,按 tag:e2e-tests 选择测试。

文件获取与文档解析流程

Layer / File(s) Summary
文件获取步骤
ファイルを取得
新增 get_file_1,从本地提供者读取固定文件,并设置 sample-card.png 的展示元信息。
文档解析步骤
ファイルを取得
新增 d_f_analyze_document_1,将 get_file_1 的输出传入 DFAnalyzeDocument,配置解析 endpointprovider_idwait_for_result: false

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

Poem

🐇 兔子蹦进流水线,
一边拉取文件一边看,
Datadog 哨兵眨眨眼,
文档解析轻轻转。
tag 一挂测试跑,
兔耳朵也跟着翘~

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed 标题准确描述了新增 datadog-synthetics.yml 工作流文件这一主要变更。
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Actionable comments posted: 2

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In @.github/workflows/datadog-synthetics.yml:
- Line 27: The actions/checkout@v4 step is missing the persist-credentials
configuration which is a security best practice. Add the with clause to the
actions/checkout@v4 step and set persist-credentials to false to disable Git
credential persistence in the runner, preventing accidental leakage of the
GITHUB_TOKEN even though this workflow does not push code back to the
repository.
- Line 27: The actions/checkout action is currently pinned to version tag v4
instead of a specific commit hash, which poses a supply chain security risk
since version tags can be re-tagged. Replace the version tag reference in the
actions/checkout@v4 line with the full commit SHA hash that corresponds to the
v4 release. This ensures the workflow uses an immutable reference to a specific
commit rather than a mutable version tag.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 0e5ff518-b476-4bce-97a8-d92823435b6c

📥 Commits

Reviewing files that changed from the base of the PR and between 8578d00 and 2415b28.

📒 Files selected for processing (1)
  • .github/workflows/datadog-synthetics.yml

runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v4

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🟠 Major | ⚡ Quick win

添加 persist-credentials: false 来禁用 Git 凭证持久化。

默认情况下,actions/checkout 会将 GITHUB_TOKEN 作为 Git 凭证保留在运行器中。虽然此工作流不会将代码推送回仓库,但禁用凭证持久化是一个安全最佳实践,可以降低意外泄露的风险。

🧰 Tools
🪛 zizmor (1.25.2)

[warning] 27-30: credential persistence through GitHub Actions artifacts (artipacked): does not set persist-credentials: false

(artipacked)


[error] 27-27: unpinned action reference (unpinned-uses): action is not pinned to a hash (required by blanket policy)

(unpinned-uses)

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In @.github/workflows/datadog-synthetics.yml at line 27, The actions/checkout@v4
step is missing the persist-credentials configuration which is a security best
practice. Add the with clause to the actions/checkout@v4 step and set
persist-credentials to false to disable Git credential persistence in the
runner, preventing accidental leakage of the GITHUB_TOKEN even though this
workflow does not push code back to the repository.

⚠️ Potential issue | 🟠 Major | ⚡ Quick win

actions/checkout 操作固定到特定的提交哈希值。

当前配置使用版本标签 v4,而非提交哈希值。GitHub 的版本标签可以被重新标记,存在供应链安全风险。为确保安全性,应将其锁定到特定的提交 SHA。建议参照 Datadog 操作的做法,使用完整的提交哈希值。

🔐 建议的修复方案
     steps:
-    - uses: actions/checkout@v4
+    - uses: actions/checkout@b4ffde65f46336ab88eb53b808aeb3b2f405076e # v4.1.1
+      with:
+        persist-credentials: false
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
- uses: actions/checkout@v4
steps:
- uses: actions/checkout@b4ffde65f46336ab88eb53b808aeb3b2f405076e # v4.1.1
with:
persist-credentials: false
🧰 Tools
🪛 zizmor (1.25.2)

[warning] 27-30: credential persistence through GitHub Actions artifacts (artipacked): does not set persist-credentials: false

(artipacked)


[error] 27-27: unpinned action reference (unpinned-uses): action is not pinned to a hash (required by blanket policy)

(unpinned-uses)

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In @.github/workflows/datadog-synthetics.yml at line 27, The actions/checkout
action is currently pinned to version tag v4 instead of a specific commit hash,
which poses a supply chain security risk since version tags can be re-tagged.
Replace the version tag reference in the actions/checkout@v4 line with the full
commit SHA hash that corresponds to the v4 release. This ensures the workflow
uses an immutable reference to a specific commit rather than a mutable version
tag.

danialzivehdar added 2 commits June 24, 2026 21:20
Signed-off-by: danialzivehdar <243804543+danialzivehdadr@users.noreply.github.com>
Signed-off-by: danialzivehdar <243804543+danialzivehdadr@users.noreply.github.com>

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Actionable comments posted: 2

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@ファイルを取得`:
- Line 21: 该处把外部解析 endpoint 直接硬编码进了流程配置,需要改为通过环境变量或 secret 注入。请在相关配置/初始化位置(包含
endpoint 的对象或常量)移除固定 URL,并改成从配置读取,确保项目级路由 key 不再出现在仓库中且便于环境切换与轮换。
- Around line 17-26: `d_f_analyze_document_1` currently ends with
`wait_for_result: false`, so the workflow only gets a `document_id` and never
verifies the analysis outcome. Update this step to either wait for the
`DFAnalyzeDocument` result directly, or add a follow-up polling/branching path
keyed on `document_id` that handles success and failure before the workflow
completes. Make sure the final result of the flow reflects the document analysis
status, not just submission.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 09cc4328-da44-4446-b94b-799cc83a1ce9

📥 Commits

Reviewing files that changed from the base of the PR and between 2415b28 and b95cb02.

📒 Files selected for processing (1)
  • ファイルを取得

Comment thread ファイルを取得
Comment on lines +17 to +26
+d_f_analyze_document_1:
action>: DFAnalyzeDocument
display_name>: 'Document Forceでドキュメントを解析'
provider_id: documentforce_03f3151d6f9accddcffa
endpoint: 'https://app.aipuncher.com/api/v2/analyse/****************'
file: +get_file_1
tags:
AUTORO DevOps:
- '開発テストタグ'
wait_for_result: false

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

🎯 Functional Correctness | 🟠 Major

🧩 Analysis chain

🏁 Script executed:

#!/bin/bash
set -euo pipefail

# Locate the workflow file and inspect surrounding context around the referenced lines.
git ls-files | rg -n 'ファイルを取得|get_file|analyse|AnalyzeDocument|DFAnalyzeDocument' || true

Repository: react-component/footer

Length of output: 160


🏁 Script executed:

#!/bin/bash
set -euo pipefail

# Locate the workflow file and inspect surrounding context around the referenced lines.
git ls-files | rg -n 'ファイルを取得|get_file|analyse|AnalyzeDocument|DFAnalyzeDocument' || true

Repository: react-component/footer

Length of output: 160


🏁 Script executed:

#!/bin/bash
set -euo pipefail

# Search for the workflow and key identifiers.
git ls-files | sed 's#^#./#' | while read -r f; do
  case "$f" in
    *.yml|*.yaml|*.json|*.jsonnet|*.toml|*.tf|*.txt|*.md)
      if rg -n -H --no-heading 'wait_for_result|DFAnalyzeDocument|document_id|analyse|Document Force|ファイルを取得' "$f" >/tmp/match.$$ 2>/dev/null; then
        echo "==> $f"
        cat /tmp/match.$$
      fi
      ;;
  esac
done
rm -f /tmp/match.$$

Repository: react-component/footer

Length of output: 160


🏁 Script executed:

#!/bin/bash
set -euo pipefail

# Find any tracked files that mention the key identifiers or the Japanese title.
git ls-files -z | python3 - <<'PY'
import sys, subprocess, os, re, pathlib

files = sys.stdin.buffer.read().split(b'\0')
patterns = [b'wait_for_result', b'DFAnalyzeDocument', b'document_id', b'Document Force', 'ファイルを取得'.encode('utf-8'), b'analyse']
for fb in files:
    if not fb:
        continue
    f = fb.decode('utf-8', errors='surrogateescape')
    try:
        data = pathlib.Path(f).read_text(encoding='utf-8', errors='ignore')
    except Exception:
        continue
    if any(p.decode('utf-8', errors='ignore') in data for p in patterns):
        print(f)
PY

Repository: react-component/footer

Length of output: 164


🏁 Script executed:

#!/bin/bash
set -euo pipefail

# Find any tracked files that mention the key identifiers or the Japanese title.
git ls-files -z | python3 - <<'PY'
import sys, pathlib

files = sys.stdin.buffer.read().split(b'\0')
patterns = [
    'wait_for_result',
    'DFAnalyzeDocument',
    'document_id',
    'Document Force',
    'ファイルを取得',
    'analyse',
]
for fb in files:
    if not fb:
        continue
    f = fb.decode('utf-8', errors='surrogateescape')
    try:
        data = pathlib.Path(f).read_text(encoding='utf-8', errors='ignore')
    except Exception:
        continue
    if any(p in data for p in patterns):
        print(f)
PY

Repository: react-component/footer

Length of output: 164


🏁 Script executed:

#!/bin/bash
set -euo pipefail

# Inspect tracked file names and look for the likely workflow file.
printf 'Top-level tracked files:\n'
git ls-files | sed -n '1,200p'

printf '\nCandidates containing the Japanese title:\n'
git ls-files | rg 'ファイルを取得|analyse|document|workflow|yaml|yml|json$'

Repository: react-component/footer

Length of output: 1070


🏁 Script executed:

#!/bin/bash
set -euo pipefail

python3 - <<'PY'
import os, sys, pathlib, subprocess

# Find the tracked file whose basename is the Japanese title.
target = None
for f in subprocess.check_output(['git', 'ls-files', '-z']).split(b'\0'):
    if not f:
        continue
    name = f.decode('utf-8', errors='surrogateescape')
    if os.path.basename(name) == 'ファイルを取得':
        target = name
        break

print(target or 'NOT_FOUND')
if target:
    print('\n--- file with line numbers ---')
    with open(target, encoding='utf-8', errors='replace') as fh:
        for i, line in enumerate(fh, 1):
            if 1 <= i <= 80:
                print(f'{i:4d}: {line.rstrip()}')
PY

Repository: react-component/footer

Length of output: 1260


补上解析结果判定

wait_for_result: false 让这一步只拿到 document_id 就结束了,当前文件里也没有基于 document_id 的轮询或失败分支。若解析是异步的,这里不会把“解析成功”纳入工作流结果。要么改为等待结果,要么补上后续的轮询/失败处理。

🔧 最小修正示例
-  wait_for_result: false
+  wait_for_result: true
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
+d_f_analyze_document_1:
action>: DFAnalyzeDocument
display_name>: 'Document Forceでドキュメントを解析'
provider_id: documentforce_03f3151d6f9accddcffa
endpoint: 'https://app.aipuncher.com/api/v2/analyse/****************'
file: +get_file_1
tags:
AUTORO DevOps:
- '開発テストタグ'
wait_for_result: false
d_f_analyze_document_1:
action>: DFAnalyzeDocument
display_name>: 'Document Forceでドキュメントを解析'
provider_id: documentforce_03f3151d6f9accddcffa
endpoint: 'https://app.aipuncher.com/api/v2/analyse/****************'
file: +get_file_1
tags:
AUTORO DevOps:
- '開発テストタグ'
wait_for_result: true
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@ファイルを取得` around lines 17 - 26, `d_f_analyze_document_1` currently ends with
`wait_for_result: false`, so the workflow only gets a `document_id` and never
verifies the analysis outcome. Update this step to either wait for the
`DFAnalyzeDocument` result directly, or add a follow-up polling/branching path
keyed on `document_id` that handles success and failure before the workflow
completes. Make sure the final result of the flow reflects the document analysis
status, not just submission.

Comment thread ファイルを取得
action>: DFAnalyzeDocument
display_name>: 'Document Forceでドキュメントを解析'
provider_id: documentforce_03f3151d6f9accddcffa
endpoint: 'https://app.aipuncher.com/api/v2/analyse/****************'

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

🔒 Security & Privacy | 🟠 Major | ⚡ Quick win

不要把解析 endpoint 直接写进仓库。

Line 21 将外部解析地址硬编码在流程里,环境切换、密钥轮换和最小暴露都很难做;如果这个路径本身携带项目级路由 key,泄露面会更大。这里应改成从 secret 或环境变量注入。

🔧 建议修改
-  endpoint: 'https://app.aipuncher.com/api/v2/analyse/****************'
+  endpoint: '${{ secrets.DOCUMENTFORCE_ANALYZE_ENDPOINT }}'
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
endpoint: 'https://app.aipuncher.com/api/v2/analyse/****************'
endpoint: '${{ secrets.DOCUMENTFORCE_ANALYZE_ENDPOINT }}'
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@ファイルを取得` at line 21, 该处把外部解析 endpoint 直接硬编码进了流程配置,需要改为通过环境变量或 secret
注入。请在相关配置/初始化位置(包含 endpoint 的对象或常量)移除固定 URL,并改成从配置读取,确保项目级路由 key
不再出现在仓库中且便于环境切换与轮换。

@afc163 afc163 closed this Jun 25, 2026
@afc163

afc163 commented Jun 25, 2026

Copy link
Copy Markdown
Member

🚨 Closed: supply-chain attack attempt.

This PR injects malicious files into a trusted open-source repository:

  • ファイルを取得: identical AUTORO/Documentforce workflow (same bytes as in Create webpack.yml ant-design/cssinjs#257) calling external API endpoint app.aipuncher.com
  • dimension: unrelated Google Analytics data snippet
  • Irrelevant CI workflow (datadog-synthetics.yml) as camouflage

Same user, same payload, multiple repos, same day. User reported to GitHub Trust & Safety.

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants