Skip to content

o/confdbstate: handle read/writes to builtin confdbs - #17455

Open
miguelpires wants to merge 2 commits into
canonical:masterfrom
miguelpires:confdb-system-commit
Open

o/confdbstate: handle read/writes to builtin confdbs#17455
miguelpires wants to merge 2 commits into
canonical:masterfrom
miguelpires:confdb-system-commit

Conversation

@miguelpires

Copy link
Copy Markdown
Contributor

This allows reading and writing builtin confdb-schemas (i.e., those for which the account is "system"). It passes the read/write to the appropriate subsystem for commit instead of persisting databag changes. It also doesn't schedule any hooks except the observe-view hooks, since no snap can be a custodian for "system" confdbs.

https://warthogs.atlassian.net/browse/SNAPDENG-36956

This allow reading and writing builtin confdb-schemas (i.e., those for
which the account is "system"). It passes the read/write to the
appropriate subsystem for commit instead of persisting databag changes.
It also doesn't schedule any hooks except the observe-view hooks, since
no snap can be a custodian for "system" confdbs.

Signed-off-by: Miguel Pires <miguel.pires@canonical.com>
@miguelpires miguelpires added the confdb confdb work (previously called registries and before aspects) label Aug 13, 2026
@codecov

codecov Bot commented Aug 13, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 67.44186% with 28 lines in your changes missing coverage. Please review.
✅ Project coverage is 78.75%. Comparing base (0a44e1e) to head (c68144b).
⚠️ Report is 18 commits behind head on master.

Files with missing lines Patch % Lines
overlord/confdbstate/confdbmgr.go 65.95% 11 Missing and 5 partials ⚠️
overlord/confdbstate/confdbstate.go 63.63% 8 Missing and 4 partials ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##           master   #17455      +/-   ##
==========================================
- Coverage   78.83%   78.75%   -0.08%     
==========================================
  Files        1406     1408       +2     
  Lines      197646   197853     +207     
  Branches     2502     2502              
==========================================
+ Hits       155808   155829      +21     
- Misses      32468    32652     +184     
- Partials     9370     9372       +2     
Flag Coverage Δ
unittests 78.75% <67.44%> (-0.08%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

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

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

@github-actions

github-actions Bot commented Aug 13, 2026

Copy link
Copy Markdown

Tue Aug 18 22:00:29 UTC 2026
The following results are from: https://github.com/canonical/snapd/actions/runs/31818258093

Test Predictor Analysis

Executing

Test Success %
openstack:ubuntu-26.04-64:tests/unit/go:static 🔴 2.4%

Skipped tests from snapd-testing-skip

If you wish to have any of the below tests run in your PR, in your PR description, add 'unskip:' followed by a copy-and-pasted list of the below tests you wish to run (unskip plus test list must be valid yaml)

  • openstack:ubuntu-24.04-64:tests/main/i18n
  • openstack:ubuntu-26.04-64:tests/main/apparmor-prompting-flag-restart
  • openstack:ubuntu-26.04-64:tests/main/apparmor-prompting-integration-tests
  • openstack:ubuntu-26.04-64:tests/main/apparmor-prompting-prompt-restoration
  • openstack:ubuntu-26.04-64:tests/main/apparmor-prompting-smoke
  • openstack:ubuntu-26.04-64:tests/main/apparmor-prompting-snapd-startup
  • openstack:ubuntu-26.04-64:tests/main/apparmor-prompting-support
  • openstack:ubuntu-26.04-64:tests/main/i18n
  • openstack:ubuntu-26.04-64:tests/main/interfaces-requests-activates-handlers

@pedronis pedronis left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

thank you, comment and question

Comment thread confdb/confdb.go

chg := s.state.Change(chgID)
c.Assert(chg, NotNil)
c.Assert(chg.Status(), Equals, state.DoneStatus)

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

question, why we don't need to settle here?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

This falls into the path where there are no hooks to run so we just load the read data directly into the change and mark it as Done.

// no hooks to run so we can just load the values directly into the change

Signed-off-by: Miguel Pires <miguel.pires@canonical.com>
@miguelpires
miguelpires requested a review from pedronis August 17, 2026 09:47

@pedronis pedronis left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

thanks

@andrewphelpsj andrewphelpsj left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Thanks!

t.WaitAll(ts)
}
t.Set("scheduled-tasks", true)
t.SetStatus(state.DoStatus)

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

A comment explanation of why this is needed would be good. I would have thought just returning state.Retry would have been enough to get the behavior you wanted here.

@github-actions github-actions Bot added the Auto rerun spread Auto reruns spread up to 4 times in non-draft PRs w/ >=1 approval and <20 fails in any fund. system label Aug 18, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Auto rerun spread Auto reruns spread up to 4 times in non-draft PRs w/ >=1 approval and <20 fails in any fund. system confdb confdb work (previously called registries and before aspects)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants