Skip to content

fix: Test and tweak pkg install#19

Merged
phuongfi91 merged 3 commits into
latestfrom
feat/phuongfi91/gpg
May 11, 2026
Merged

fix: Test and tweak pkg install#19
phuongfi91 merged 3 commits into
latestfrom
feat/phuongfi91/gpg

Conversation

@phuongfi91
Copy link
Copy Markdown
Contributor

No description provided.

Copilot AI review requested due to automatic review settings May 11, 2026 03:03
@qodo-code-review
Copy link
Copy Markdown

Review Summary by Qodo

Fix GPG package installation and update version test

🐞 Bug fix 🧪 Tests

Grey Divider

Walkthroughs

Description
• Replace separate gpg and gpg-agent packages with gnupg
• Update GPG version test to match actual output format
• Simplify package installation with unified GPG package
Diagram
flowchart LR
  A["Dockerfile packages"] -- "replace gpg + gpg-agent" --> B["gnupg package"]
  C["GPG version test"] -- "update expected output" --> D["gpg output format"]
Loading

Grey Divider

File Changes

1. Dockerfile Dependencies +1/-2

Replace separate GPG packages with gnupg

• Removed separate gpg and gpg-agent packages
• Added unified gnupg package as replacement
• Consolidates GPG-related dependencies into single package

Dockerfile


2. tests/specs.yaml 🧪 Tests +1/-1

Update GPG version test expected output

• Updated GPG version test expected output from ["gpg (GnuPG)"] to ["gpg"]
• Aligns test expectations with actual gnupg package output format

tests/specs.yaml


Grey Divider

Qodo Logo

@qodo-code-review
Copy link
Copy Markdown

qodo-code-review Bot commented May 11, 2026

Code Review by Qodo

🐞 Bugs (2) 📘 Rule violations (0)

Grey Divider


Remediation recommended

1. GPG test too permissive 🐞 Bug ☼ Reliability
Description
tests/specs.yaml now only asserts that gpg --version output contains gpg, which weakens the
test and can let regressions slip (e.g., wrong/partial output still matching). This is especially
relevant since other tests rely on partial/pattern matching semantics, so overly-generic patterns
reduce confidence.
Code

tests/specs.yaml[25]

+    expectedOutput: ["gpg"]
Evidence
The gpg test was changed from a more specific expected output to a generic one. The same test file
also demonstrates the suite relies on partial/pattern matching (e.g., node --version only checks
for v2), which makes choosing sufficiently-specific patterns important to keep the test
meaningful.

tests/specs.yaml[22-26]
tests/specs.yaml[119-123]

Agent prompt
The issue below was found during a code review. Follow the provided context and guidance below and implement a solution

### Issue description
The `gpg --version` container-structure-test assertion is now very broad (`expectedOutput: ["gpg"]`), which reduces the test’s ability to detect regressions.

### Issue Context
Other tests in the same suite use partial/pattern matching (e.g., `node --version` expecting just `v2`), so test patterns should remain specific enough to validate the intended tool/implementation.

### Fix Focus Areas
- tests/specs.yaml[22-26]

### Suggested change
Update the `gpg` test to match a more specific signature while remaining compatible with version differences, e.g.:
- `expectedOutput: ["^gpg \\(GnuPG\\)"]`

(If the harness treats expectedOutput entries as regex patterns, escaping the parentheses keeps the check specific without being brittle to version changes.)

ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools



Advisory comments

2. gpg-agent no longer asserted 🐞 Bug ⚙ Maintainability
Description
The Dockerfile no longer explicitly lists gpg-agent in the apt install set, and the test suite
only verifies gpg is present. If gpg-agent was an intended guarantee of the image (as implied by
the previous explicit install), that expectation is no longer protected by tests.
Code

Dockerfile[98]

+    gnupg \
Evidence
The apt package list now installs gnupg but does not explicitly include gpg-agent, and the tests
only validate the gpg command. This means the previous explicit dependency is no longer directly
asserted anywhere in-repo.

Dockerfile[91-102]
tests/specs.yaml[22-26]

Agent prompt
The issue below was found during a code review. Follow the provided context and guidance below and implement a solution

### Issue description
The image previously declared `gpg-agent` explicitly, but after switching to `gnupg` the test suite doesn’t verify that `gpg-agent` is still available.

### Issue Context
Even if `gnupg` currently provides `gpg-agent`, adding a simple presence check prevents accidental future drift and documents the expectation.

### Fix Focus Areas
- tests/specs.yaml[22-40]

### Suggested change
Add a command test such as:
```yaml
- name: "gpg-agent is installed in path"
 command: "gpg-agent"
 args: ["--version"]
 expectedOutput: ["gpg-agent"]
```
If `gpg-agent` is not a required guarantee of this image, consider explicitly documenting that by removing the expectation (and ensuring no docs/scripts imply it).

ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools


Grey Divider

Qodo Logo

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

This PR updates the dev image’s GPG installation to use Debian’s gnupg package and relaxes the corresponding container-structure-test assertion so it remains stable across output formatting differences.

Changes:

  • Replace gpg/gpg-agent APT installs with gnupg in the Dockerfile.
  • Update the gpg --version test expectation in tests/specs.yaml to match a less specific substring.

Reviewed changes

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

File Description
Dockerfile Switches GPG-related APT packages to gnupg.
tests/specs.yaml Adjusts the gpg --version expected output match to be less strict.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Copy link
Copy Markdown

@gemini-code-assist gemini-code-assist Bot left a comment

Choose a reason for hiding this comment

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

Code Review

This pull request replaces the gpg and gpg-agent packages with gnupg in the Dockerfile and updates the corresponding command test in specs.yaml. Feedback was provided regarding the test update, noting that reducing the expected output string to just "gpg" decreases test specificity and could lead to false positives.

Comment thread tests/specs.yaml
command: "gpg"
args: ["--version"]
expectedOutput: ["gpg (GnuPG)"]
expectedOutput: ["gpg"]
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

medium

The expected output for the gpg command has been simplified from gpg (GnuPG) to just gpg. This reduces the specificity of the test, as gpg is a very common string and might lead to false positives (e.g., if the command fails but the error message contains the word 'gpg'). It is recommended to keep the more specific string to ensure the correct GnuPG implementation is present and working as expected.

    expectedOutput: ["gpg (GnuPG)"]

@phuongfi91 phuongfi91 merged commit 9820f1f into latest May 11, 2026
10 checks passed
@phuongfi91 phuongfi91 deleted the feat/phuongfi91/gpg branch May 11, 2026 03:10
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