Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

MNT: make happi repair not save items that have no changed fields #343

Merged
merged 6 commits into from
Sep 26, 2024

Conversation

nstelter-slac
Copy link
Contributor

@nstelter-slac nstelter-slac commented Aug 26, 2024

Description

Make it so running happi repair only saves an item if it had a field actually changed during the repair process. This stops the last_edit times from being updated on unchanged items.

Also, it wasn't immediately clear to me how to use the cli along with the example db.json (so I could try commands on a small example db). So added an example cfg and some instructions to the README to make this easy.

Motivation and Context

closes #324

How Has This Been Tested?

Manually tested and verified, and test case added.

Where Has This Been Documented?

In function's doc string and comments.

Pre-merge checklist

  • Code works interactively
  • Code contains descriptive docstrings, including context and API
  • New/changed functions and methods are covered in the test suite where possible
  • Test suite passes locally
  • Test suite passes on GitHub Actions
  • Ran docs/pre-release-notes.sh and created a pre-release documentation page
  • Pre-release docs include context, functional descriptions, and contributors as appropriate

@tangkong
Copy link
Contributor

Strange that the multi-backend test is only now failing, after being like that for some time. That failure is unrelated to the changes you made here.

@nstelter-slac nstelter-slac marked this pull request as ready for review August 27, 2024 00:53
@nstelter-slac nstelter-slac marked this pull request as draft August 27, 2024 00:53
@nstelter-slac
Copy link
Contributor Author

nstelter-slac commented Aug 27, 2024

think my github account needs more permissions in this repo, i cant seem to run CI or add reviewers

@nstelter-slac
Copy link
Contributor Author

also sry im setting my PRs as drafts atm b/c still need to fill out descriptions

@nstelter-slac nstelter-slac marked this pull request as ready for review September 24, 2024 04:07
@nstelter-slac nstelter-slac force-pushed the repair_no_changes branch 3 times, most recently from 41257be to 2d9cda9 Compare September 24, 2024 06:41
@nstelter-slac nstelter-slac changed the title MNT: make happi repair not save if no changes were made MNT: make happi repair not save ite if no changes were made to it Sep 24, 2024
@nstelter-slac nstelter-slac changed the title MNT: make happi repair not save ite if no changes were made to it MNT: make happi repair not save an item if no changes were made to it Sep 24, 2024
@nstelter-slac nstelter-slac force-pushed the repair_no_changes branch 2 times, most recently from 827ac12 to 0f9c3ae Compare September 24, 2024 17:21
…json. Added example cfg and instruction to make this easy.
@nstelter-slac nstelter-slac changed the title MNT: make happi repair not save an item if no changes were made to it MNT: make happi repair not save items that have no changed fields Sep 24, 2024
ZLLentz
ZLLentz previously approved these changes Sep 24, 2024
Copy link
Member

@ZLLentz ZLLentz left a comment

Choose a reason for hiding this comment

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

I think this looks great, no objections or notes from me (aside from the pre-rel self-credit)

tangkong
tangkong previously approved these changes Sep 24, 2024
Copy link
Contributor

@tangkong tangkong left a comment

Choose a reason for hiding this comment

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

This looks good to me too! Just a small test case nitpick but other than that I'm on board 👍

happi/tests/test_cli.py Outdated Show resolved Hide resolved
happi/tests/test_cli.py Outdated Show resolved Hide resolved
@nstelter-slac nstelter-slac dismissed stale reviews from tangkong and ZLLentz via 27fd291 September 25, 2024 20:54
@ZLLentz ZLLentz merged commit 0f61759 into pcdshub:master Sep 26, 2024
11 checks passed
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.

MNT: happi repair should not save if no changes were made
3 participants