Skip to content

feat: test docker container on pull request#59

Merged
bernacodesido merged 3 commits intorootstockfrom
test_docker-container
Jun 9, 2025
Merged

feat: test docker container on pull request#59
bernacodesido merged 3 commits intorootstockfrom
test_docker-container

Conversation

@bernacodesido
Copy link
Copy Markdown
Member

Test docker container on pull request using example config which was also updated.

Copilot AI review requested due to automatic review settings June 3, 2025 17:45
@github-actions
Copy link
Copy Markdown

github-actions bot commented Jun 3, 2025

Dependency Review

✅ No vulnerabilities or license issues or OpenSSF Scorecard issues found.

OpenSSF Scorecard

PackageVersionScoreDetails
actions/actions/checkout 11bd71901bbe5b1630ceea73d27597364c9af683 🟢 5.3
Details
CheckScoreReason
Maintained⚠️ 00 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 0
Binary-Artifacts🟢 10no binaries found in the repo
Code-Review🟢 10all changesets reviewed
Dangerous-Workflow🟢 10no dangerous workflow patterns detected
CII-Best-Practices⚠️ 0no effort to earn an OpenSSF best practices badge detected
Token-Permissions⚠️ 0detected GitHub workflow tokens with excessive permissions
Fuzzing⚠️ 0project is not fuzzed
License🟢 10license file detected
Packaging⚠️ -1packaging workflow not detected
Signed-Releases⚠️ -1no releases found
Pinned-Dependencies🟢 3dependency not pinned by hash detected -- score normalized to 3
Security-Policy🟢 9security policy file detected
Branch-Protection⚠️ -1internal error: error during GetBranch(releases/v2): error during branchesHandler.query: internal error: githubv4.Query: Resource not accessible by integration
SAST🟢 9SAST tool detected but not run on all commits
Vulnerabilities⚠️ 19 existing vulnerabilities detected

Scanned Files

  • .github/workflows/docker.yml

Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

Adds Slack credentials and example address/signers to the sample config, and introduces a GitHub Actions workflow to build and smoke–test the Docker container on PRs.

  • Expanded config.example.yaml with Slack tokens, channel IDs, and extra safe addresses/signers.
  • Added .github/workflows/docker.yml to validate Docker build and container startup logs.

Reviewed Changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 4 comments.

File Description
config.example.yaml Updated example config with Slack settings and extra entries for safeAddresses and signers
.github/workflows/docker.yml New workflow to build the Docker image and verify healthcheck log output
Comments suppressed due to low confidence (2)

config.example.yaml:8

  • [nitpick] The signer value "Alice" uses title case, while existing entries use lowercase (e.g. "alice"). Consider normalizing casing to maintain consistency.
  "0x1234567890123456789012345678901234567890": "Alice"

config.example.yaml:6

  • The YAML mapping here is invalid: you have a scalar list entry with a colon inside quotes and no proper mapping structure. Consider using a mapping under safeAddresses instead of a quoted string.
- "rsk:0x0000000000000000000000000000000000000001": "Safe 1"

Comment thread config.example.yaml
@@ -1,7 +1,10 @@
telegramBotToken: "xxxx"
telegramChannelId: "-1111"
slackBotToken: "xoxb-1234567890-1234567890-1234567890"
Copy link

Copilot AI Jun 3, 2025

Choose a reason for hiding this comment

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

Use placeholder syntax (e.g. <SLACK_BOT_TOKEN>) instead of a realistic-looking token to avoid confusion and accidental leaks.

Suggested change
slackBotToken: "xoxb-1234567890-1234567890-1234567890"
slackBotToken: "<SLACK_BOT_TOKEN>"

Copilot uses AI. Check for mistakes.

steps:
- name: Checkout
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 #v4.2.2
Copy link

Copilot AI Jun 3, 2025

Choose a reason for hiding this comment

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

Pinning to a specific commit SHA can make upgrades harder; consider using the version tag (e.g. actions/checkout@v4) for clearer maintenance.

Suggested change
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 #v4.2.2
uses: actions/checkout@v4.2.2

Copilot uses AI. Check for mistakes.
set -e

docker build -t safe-watcher:latest .
container_id=$(docker run -d --name safe-watcher-container -v $(pwd)/config.example.yaml:/app/config.yaml safe-watcher:latest)
Copy link

Copilot AI Jun 3, 2025

Choose a reason for hiding this comment

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

Add the --rm flag to docker run to automatically clean up the container after stopping, avoiding leftover containers on the runner.

Suggested change
container_id=$(docker run -d --name safe-watcher-container -v $(pwd)/config.example.yaml:/app/config.yaml safe-watcher:latest)
container_id=$(docker run -d --rm --name safe-watcher-container -v $(pwd)/config.example.yaml:/app/config.yaml safe-watcher:latest)

Copilot uses AI. Check for mistakes.
attempts=0
count=0

while [ $attempts -lt $max_attempts ]; do
Copy link

Copilot AI Jun 3, 2025

Choose a reason for hiding this comment

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

This loop polls without delay and may spin CPU. Insert a sleep 1 (or appropriate interval) inside the loop to avoid busy–waiting.

Copilot uses AI. Check for mistakes.
@bernacodesido bernacodesido force-pushed the test_docker-container branch from 1fc1943 to 9154c71 Compare June 3, 2025 17:50
@bernacodesido bernacodesido merged commit 13c046d into rootstock Jun 9, 2025
7 checks passed
@bernacodesido bernacodesido deleted the test_docker-container branch June 9, 2025 17:52
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.

3 participants