Skip to content

Added a script to update a beamline#235

Merged
padraic-shafer merged 7 commits intoNSLS2:mainfrom
anubhutisinha04:update-service-accounts
Feb 5, 2026
Merged

Added a script to update a beamline#235
padraic-shafer merged 7 commits intoNSLS2:mainfrom
anubhutisinha04:update-service-accounts

Conversation

@anubhutisinha04
Copy link
Contributor

This PR introduces a new update script that modifies only the required fields when changes are needed, instead of creating a new object on every update.

The new approach selectively updates specific values, eliminating unintended side effects.

Copy link
Contributor

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 introduces a new utility script for updating beamline records in the database. The script provides a targeted approach to modify specific fields (service accounts) without recreating the entire beamline object, addressing concerns about unintended side effects from full object replacement.

Changes:

  • Added scripts/update_beamline.py to enable selective field updates for beamline records
  • Script fetches an existing beamline by PASS ID and updates only the service_accounts field

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

Copy link
Contributor

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

Copilot reviewed 1 out of 1 changed files in this pull request and generated 1 comment.


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

Copy link
Contributor

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

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


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

Copy link
Collaborator

@padraic-shafer padraic-shafer left a comment

Choose a reason for hiding this comment

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

Thanks for making this script. You had a good idea to handle it separately from beamline creation.

In this case, only the service accounts were updated, but it would be good to point out where someone should inject additional changes, if needed.

I think it would be good practice to show the new object before it gets saved.

@padraic-shafer padraic-shafer merged commit 7a4804b into NSLS2:main Feb 5, 2026
3 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.

2 participants