Skip to content

Conversation

@spencerugbo
Copy link
Contributor

@spencerugbo spencerugbo commented Nov 19, 2025

Proposed changes

Add unreferenced file support to the mock management plane and add integration tests for it.

When sending a config apply request through the mock, the mock looks at the request body to identify unreferenced files. Here is a sample request body of a config apply that contains an unreferenced file:

   {
        "unreferencedFiles": [
            {
                "file_meta": {
                    "name": "/opt/homebrew/etc/nginx/test/unreferenced.conf",
                    "permissions": "0644"
                }
            }
        ]
    }

Checklist

Before creating a PR, run through this checklist and mark each as complete.

  • I have read the CONTRIBUTING document
  • I have run make install-tools and have attached any dependency changes to this pull request
  • If applicable, I have added tests that prove my fix is effective or that my feature works
  • If applicable, I have checked that any relevant tests pass after adding my changes
  • If applicable, I have updated any relevant documentation (README.md)
  • If applicable, I have tested my cross-platform changes on Ubuntu 22, Redhat 8, SUSE 15 and FreeBSD 13

@spencerugbo spencerugbo requested a review from a team as a code owner November 19, 2025 14:00
@spencerugbo spencerugbo self-assigned this Nov 19, 2025
@github-actions github-actions bot added the chore Pull requests for routine tasks label Nov 19, 2025
@codecov
Copy link

codecov bot commented Nov 19, 2025

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 85.28%. Comparing base (012b734) to head (145dfad).
⚠️ Report is 35 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #1399      +/-   ##
==========================================
- Coverage   86.28%   85.28%   -1.00%     
==========================================
  Files         102      102              
  Lines       12572    12928     +356     
==========================================
+ Hits        10848    11026     +178     
- Misses       1248     1416     +168     
- Partials      476      486      +10     

see 23 files with indirect coverage changes


Continue to review full report in Codecov by Sentry.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 012b734...145dfad. Read the comment docs.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

"test", "-f", "/etc/nginx/test/unreferenced_file.conf",
})
s.Require().NoError(err)
s.Equal(0, code)
Copy link
Collaborator

Choose a reason for hiding this comment

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

Should this be checking if the code is 1?

s.Equal(mpi.CommandResponse_COMMAND_STATUS_OK, responses[0].GetCommandResponse().GetStatus())
s.Equal("Config apply successful", responses[0].GetCommandResponse().GetMessage())

code, _, err = utils.Container.Exec(s.ctx, []string{
Copy link
Collaborator

Choose a reason for hiding this comment

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

Can you add these file checks to all the tests in this test suite?

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

Labels

chore Pull requests for routine tasks

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants