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

Reset key in registry #330

Merged
merged 4 commits into from
Nov 29, 2022
Merged

Reset key in registry #330

merged 4 commits into from
Nov 29, 2022

Conversation

jburel
Copy link
Member

@jburel jburel commented Nov 25, 2022

add ability to reset the value of specified keys in registry
To test the proposed changed.

  • Connect to a server with omero.qa.feedback configured.
  • Select Switch user in menu and connect to another server without configuration
  • Check that the qa url has changed to the value defined in container.xml
    cc @sbesson

@sbesson sbesson self-requested a review November 25, 2022 13:51
Copy link
Member

@sbesson sbesson left a comment

Choose a reason for hiding this comment

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

Functionally, this worked as expected. A few comments/suggestions on the APIs/implementations.

* @throws ConfigException If an error occurs while accessing the file
* or the file contents are not valid.
*/
public static void rebindFromFile(String file, Registry reg, List<String> keys)
Copy link
Member

Choose a reason for hiding this comment

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

Same as above, would using the same method name make the intent clearer?

{

try {
RegistryFactory.rebindFromFile(container.getConfigFileRelative(), registry, keys);
Copy link
Member

Choose a reason for hiding this comment

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

Should a debug level logging statement be added to the log to indicate that some keys are being reset?

Copy link
Member Author

Choose a reason for hiding this comment

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

good idea

@jburel jburel requested a review from sbesson November 28, 2022 14:16
Copy link
Member

@sbesson sbesson left a comment

Choose a reason for hiding this comment

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

% tail -F ~/omero/log/omeroinsight.log | grep DataServices
2022-11-29 08:40:12,583 DEBUG [ o.o.shoola.env.data.DataServicesFactory] (entQueue-0) Using URL defined server-side for feedback: http://qa.openmicroscopy.org.uk
2022-11-29 08:40:12,583 INFO  [ o.o.shoola.env.data.DataServicesFactory] (entQueue-0) Server version: 5.6.5
2022-11-29 08:40:32,584 DEBUG [ o.o.shoola.env.data.DataServicesFactory] (entQueue-0) Server error: ome.conditions.SecurityViolation - Cannot read configuration: omero.qa.feedback
2022-11-29 08:40:32,589 DEBUG [ o.o.shoola.env.data.DataServicesFactory] (entQueue-0) The following keys have been reset:/services/DEBUGGER/hostnameToken, /services/DEBUGGER/hostnameProcessing, 
2022-11-29 08:40:32,589 INFO  [ o.o.shoola.env.data.DataServicesFactory] (entQueue-0) Server version: 5.6.5
2022-11-29 08:41:23,759 DEBUG [ o.o.shoola.env.data.DataServicesFactory] (entQueue-0) The following keys have been reset:/services/DEBUGGER/hostnameToken, /services/DEBUGGER/hostnameProcessing, 
2022-11-29 08:41:23,759 INFO  [ o.o.shoola.env.data.DataServicesFactory] (entQueue-0) Server version: 5.6.5
2022-11-29 08:42:07,691 DEBUG [ o.o.shoola.env.data.DataServicesFactory] (entQueue-0) Server error: ome.conditions.SecurityViolation - Cannot read configuration: omero.qa.feedback
2022-11-29 08:42:07,694 DEBUG [ o.o.shoola.env.data.DataServicesFactory] (entQueue-0) The following keys have been reset:/services/DEBUGGER/hostnameToken, /services/DEBUGGER/hostnameProcessing, 
2022-11-29 08:42:37,014 DEBUG [ o.o.shoola.env.data.DataServicesFactory] (entQueue-0) Using URL defined server-side for feedback: http://qa.openmicroscopy.org.uk
2022-11-29 08:42:37,015 INFO  [ o.o.shoola.env.data.DataServicesFactory] (entQueue-0) Server version: 5.6.5

@jburel jburel merged commit 9fc1585 into ome:master Nov 29, 2022
@jburel jburel deleted the reset_key branch March 20, 2023 22:33
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