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

Ops: Script to fix project preferences #2920

Merged
merged 2 commits into from
Apr 10, 2019

Conversation

ChristianBeer
Copy link
Member

Description of the Change
Adds a script that does some maintenance on project specific preferences. Currently does:

  • squash duplicate app_id entries (and optionally delete deprecated appids)
  • delete empty venue tags (confuses older clients)
  • migrate preset from attribute to tag (Drupal specific)
  • validates the XML snippet

Alternate Designs
Can be done using other script languages but we already have everything in place for PHP to work well with the DB.

Release Notes
N/A

Do some maintenance on project specific preferences. Currently does:
* squash duplicate app_id entries (and optionally delete deprecated appids)
* delete empty venue tags (confuses older clients)
* migrate preset from attribute to tag (Drupal specific)
* validates the XML snippet
@lfield
Copy link
Contributor

lfield commented Apr 9, 2019

I just tried this and got the following error.

PHP Fatal error: Cannot use object of type DOMNodeList as array in /boincdata/boinc/project/lhcathome-dev/html/ops/fix_project_prefs.php on line 62

Treating a DOMNodeList as an array seems to have worked in PHP5 but it is not with PHP7.
@ChristianBeer
Copy link
Member Author

Fixed. Please try again. I don't have access to a project where I can test this myself anymore.

@lfield
Copy link
Contributor

lfield commented Apr 10, 2019

I tested this and it looks like it did not break our dev project. I am happy to merge this as unless you chose to execute this script, it will have no affect on the code base. However, why do we need to have a 'fix' script in the first place? Suggests that something else is broken which should be fixed.

@ChristianBeer
Copy link
Member Author

This script was originally developed for Einstein@Home which treats selection of apps differently and also uses Drupal to manage the preferences and has stricter requirements on XML validity. So while fixing project specific things I wrote this script to fix the EaH database. As this might be useful for other projects that encounter problems with the project specific XML it might be handy to have a script ready that just needs to be augmented to fix a future problem. This is also a good start for a validation mechanism.

@lfield lfield merged commit e3af009 into master Apr 10, 2019
@brevilo
Copy link
Contributor

brevilo commented Apr 11, 2019

Hi Christian, can you remind me about the following:

  • "which treats selection of apps differently": in which way? we're certainly upstream-compatible
  • "also uses Drupal to manage the preferences": how does that concern non-project-specific preferences?

Thanks

@lfield lfield deleted the cb_fix_project_preferences_script branch April 11, 2019 07:35
@ChristianBeer
Copy link
Member Author

"which treats selection of apps differently": in which way? we're certainly upstream-compatible

In the way how EaH adds new apps to the selection which resulted in duplicate entries and deprecated apps being still present in the preferences. This might be true for other projects using this selection mechanism too. So it might not be specific to EaH but at the time I only had the EaH specific cases in mind.

"also uses Drupal to manage the preferences": how does that concern non-project-specific preferences?

I meant the project specific preferences in Drupal. Which in the beginning used an attribute to mark presets (in addition to venues) but when we found out that the Client can't handle a second attribute we switched from attribute to tag. This is the Drupal specific part I meant.

@brevilo
Copy link
Contributor

brevilo commented Apr 12, 2019

Right, that makes sense. Thanks!

@AenBleidd AenBleidd added this to the Server Release 1.2.0 milestone Aug 14, 2023
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.

4 participants