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

Add `smwgConfigFileDir`, refs 3506, 3563 #3596

Merged
merged 1 commit into from Jan 12, 2019

Conversation

Projects
None yet
2 participants
@mwjames
Copy link
Contributor

mwjames commented Jan 12, 2019

This PR is made in reference to: #3095, #3506, #3563

This PR addresses or contains:

  • Adds smwgConfigFileDir to specify the location (e.g. $smwgConfigFileDir = __DIR__ . "/../.config/{$wgDBname}";) that is expected to be writable and persistent (by default uses the SMW extension root)
  • Raises a FileNotWritableException when the file cannot be written
  • Using the wiki-id as internal identifier (#3563) in the file to distinguish between different instances
  • smwgUpgradeKey uses a new schema 'smw:2018-09-01' to identify core changes with other extensions being able to alter the key by adding their own sesp:.. identifier when modify the DB structure (adding fixed tables etc.)

This change when backported will cause the upgrade key to be regenerated now that includes the wiki-id (and new schema) as factor for comparing values.

This PR includes:

  • Tests (unit/integration)
  • CI build passed

Fixes #3506, Fixes #3563

@mwjames mwjames merged commit 056524c into master Jan 12, 2019

2 checks passed

continuous-integration/travis-ci/pr The Travis CI build passed
Details
continuous-integration/travis-ci/push The Travis CI build passed
Details

@mwjames mwjames deleted the config-file branch Jan 12, 2019

@mwjames mwjames referenced this pull request Jan 12, 2019

Merged

Extend upgrade error msg, refs 3095, 3596 #3597

1 of 2 tasks complete
@kghbln

This comment has been minimized.

Copy link
Member

kghbln commented Jan 12, 2019

@mwjames I guess it is save to back-port to 3.0.x?

@kghbln kghbln added this to the SMW 3.0.1 milestone Jan 12, 2019

@mwjames

This comment has been minimized.

Copy link
Contributor Author

mwjames commented Jan 12, 2019

The now reformatted .smw.json looks similar to:

{
    "mw-31-00": {
        "upgrade_key": "e5a8987dbe25128a59b1890248deeef33ae6390a"
    },
    "mw-31-00-sunittest_": {
        "upgrade_key": "3c482dd42293f2497baad5a758702427dab3500b"
    }
}

It includes the wiki-id reference and the upgrade_key which we use for comparison. In future other keys might be stored to allow for a more fine grained method to watch the state of the DB and setup.

PS: If you delete the file, you'll be seeing the error screen and if someone manipulates the key s(he) will cause the error screen as well and you are required to run update.php or setupStore.php

@kghbln

This comment has been minimized.

Copy link
Member

kghbln commented Jan 12, 2019

Coincidentally I am just creating the docu or will do so:

@mwjames

This comment has been minimized.

Copy link
Contributor Author

mwjames commented Jan 12, 2019

As explained in #3605 (comment), the sha1 is compromised of different keys/values. The smwgUpgradeKey is only one component to allow a developer to force an update when s(he) changes the shape of tables/indices directly.

The #3597 has changed the error message so that smwgUpgradeKey is displayed directly to the end-user to improve clarity in case of support questions.

@mwjames mwjames referenced this pull request Jan 13, 2019

Merged

Add `populateHashField.php` #3611

2 of 2 tasks complete
@kghbln

This comment has been minimized.

Copy link
Member

kghbln commented Jan 18, 2019

Back-ported with a6ccc2a

@mwjames mwjames referenced this pull request Feb 16, 2019

Open

Add SetupFile, refs 3596 #3715

2 of 2 tasks complete
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment