Stargate Rewritten

Stargate Rewritten

241 Downloads

Rewrite Migration Logging Inconsistency [TMS 222177]

Pheotis opened this issue ยท 3 comments

commented

When an older copy of the rewritten config is migrated to a newer version, it works as expected.
That is, except loggingLevel, which reverts to INFO regardless of what its existing value was.

Environment

Plugin Version: ALPHA-1.0.0.4 (Migrating simulated 1.0.0.2 config, Test Environment unit 2-Spigot-Offline-MigOld-Modern-SQL)
Server Version: 3491-Spigot-b081915-95d233d (MC: 1.18.2) Implementing API Version 1.18.2-R0.1-SNAPSHOT

Description.

Input

See here

# Possible Values:
#   |=> SEVERE (Not recommended).
#   |   - ๐‡๐ข๐๐ž ๐ž๐ฏ๐ž๐ซ๐ฒ๐ญ๐ก๐ข๐ง๐ . ๐‘‚๐‘›๐‘™๐‘ฆ ๐‘๐‘Ÿ๐‘–๐‘›๐‘ก ๐‘ก๐‘œ ๐‘๐‘œ๐‘›๐‘ ๐‘œ๐‘™๐‘’ ๐‘–๐‘“ ๐‘๐‘™๐‘ข๐‘”๐‘–๐‘› ๐‘“๐‘Ž๐‘ก๐‘Ž๐‘™๐‘™๐‘ฆ ๐‘๐‘Ÿ๐‘Ž๐‘ โ„Ž๐‘’๐‘ 
#   |=> WARNING (Recommended for large and well-tested production implementations).
#   |   - ๐‡๐ข๐๐ž ๐ง๐จ๐ซ๐ฆ๐š๐ฅ ๐›๐ž๐ก๐š๐ฏ๐ข๐จ๐ฎ๐ซ. ๐‘‚๐‘›๐‘™๐‘ฆ ๐‘๐‘Ÿ๐‘–๐‘›๐‘ก ๐‘๐‘œ๐‘ก๐‘’๐‘›๐‘ก๐‘–๐‘Ž๐‘™ ๐‘–๐‘ ๐‘ ๐‘ข๐‘’๐‘ .
#   |=> INFO (Recommended for most production implementations).
#   |   - ๐๐ซ๐ข๐ง๐ญ ๐ง๐จ๐ซ๐ฆ๐š๐ฅ ๐›๐ž๐ก๐š๐ฏ๐ข๐จ๐ฎ๐ซ. ๐‘ƒ๐‘Ÿ๐‘–๐‘›๐‘ก๐‘  ๐‘๐‘œ๐‘Ÿ๐‘ก๐‘Ž๐‘™ ๐‘’๐‘ฃ๐‘’๐‘›๐‘ก๐‘  (๐‘ข๐‘ ๐‘Ž๐‘”๐‘’, ๐‘๐‘Ÿ๐‘’๐‘Ž๐‘ก๐‘–๐‘œ๐‘›, ๐‘‘๐‘’๐‘ ๐‘ก๐‘Ÿ๐‘ข๐‘๐‘ก๐‘–๐‘œ๐‘›, ๐‘’๐‘ก๐‘.)
#   |=> CONFIG (Useful for configuring preproduction instances).
#   |   - ๐๐ซ๐ข๐ง๐ญ ๐ฉ๐ž๐ซ๐ฆ๐ข๐ฌ๐ฌ๐ข๐จ๐ง ๐œ๐ก๐ž๐œ๐ค๐ฌ. ๐‘ƒ๐‘Ÿ๐‘–๐‘›๐‘ก๐‘  ๐‘โ„Ž๐‘’๐‘๐‘˜๐‘  ๐‘š๐‘Ž๐‘‘๐‘’ ๐‘ก๐‘œ ๐‘‘๐‘’๐‘ก๐‘’๐‘Ÿ๐‘š๐‘–๐‘›๐‘’ ๐‘–๐‘“ ๐‘๐‘™๐‘Ž๐‘ฆ๐‘’๐‘Ÿ๐‘  ๐‘๐‘Ž๐‘› ๐‘๐‘’๐‘Ÿ๐‘“๐‘œ๐‘Ÿ๐‘š ๐‘Ž๐‘› ๐‘Ž๐‘๐‘ก๐‘–๐‘œ๐‘›.
#   |=> FINE (Recommended for basic troubleshooting).
#   |   - ๐๐ซ๐ข๐ง๐ญ ๐ฅ๐ข๐ฆ๐ข๐ญ๐ž๐ ๐๐ž๐›๐ฎ๐  ๐ข๐ง๐Ÿ๐จ. ๐‘ƒ๐‘Ÿ๐‘–๐‘›๐‘ก๐‘  ๐‘”๐‘’๐‘›๐‘’๐‘Ÿ๐‘Ž๐‘™ ๐‘๐‘™๐‘ข๐‘”๐‘–๐‘› ๐‘’๐‘ฃ๐‘’๐‘›๐‘ก๐‘  (๐‘™๐‘œ๐‘Ž๐‘‘๐‘–๐‘›๐‘”, ๐‘‘๐‘–๐‘ ๐‘Ž๐‘๐‘™๐‘–๐‘›๐‘”, ๐‘๐‘œ๐‘›๐‘›๐‘’๐‘๐‘ก๐‘–๐‘œ๐‘›๐‘ , ๐‘’๐‘ก๐‘.).
#   |=> FINER (Recommended for some addon developers).
#   |   - ๐๐ซ๐ข๐ง๐ญ ๐ฆ๐จ๐ฌ๐ญ ๐๐ž๐›๐ฎ๐  ๐ข๐ง๐Ÿ๐จ. ๐‘ƒ๐‘Ÿ๐‘–๐‘›๐‘ก๐‘  ๐‘š๐‘’๐‘ ๐‘ ๐‘Ž๐‘”๐‘’๐‘  ๐‘‘๐‘’๐‘ก๐‘Ž๐‘–๐‘™๐‘–๐‘›๐‘” ๐‘กโ„Ž๐‘’ ๐‘๐‘™๐‘ข๐‘”๐‘–๐‘›'๐‘  ๐‘™๐‘œ๐‘”๐‘–๐‘ ๐‘Ž๐‘›๐‘‘ ๐‘๐‘’โ„Ž๐‘Ž๐‘ฃ๐‘–๐‘œ๐‘ข๐‘Ÿ.
#   |=> FINEST (Only used by StarGate's core development team).
#   |   - ๐๐ซ๐ข๐ง๐ญ ๐ž๐ฏ๐ž๐ซ๐ฒ๐ญ๐ก๐ข๐ง๐ . ๐‘ƒ๐‘Ÿ๐‘–๐‘›๐‘ก๐‘  ๐‘™๐‘–๐‘ก๐‘’๐‘Ÿ๐‘Ž๐‘™๐‘™๐‘ฆ ๐‘’๐‘ฃ๐‘’๐‘Ÿ๐‘ฆ๐‘กโ„Ž๐‘–๐‘›๐‘”, ๐‘–๐‘›๐‘๐‘™๐‘ข๐‘‘๐‘–๐‘›๐‘” ๐‘›๐‘ข๐‘š๐‘’๐‘Ÿ๐‘œ๐‘ข๐‘  ๐‘ ๐‘ก๐‘Ž๐‘๐‘˜ ๐‘ก๐‘Ÿ๐‘Ž๐‘๐‘’๐‘ .
loggingLevel: FINE

Migrated Output:

# Possible Values:
#   |=> SEVERE (Not recommended).
#   |   - ๐‡๐ข๐๐ž ๐ž๐ฏ๐ž๐ซ๐ฒ๐ญ๐ก๐ข๐ง๐ . ๐‘‚๐‘›๐‘™๐‘ฆ ๐‘๐‘Ÿ๐‘–๐‘›๐‘ก ๐‘ก๐‘œ ๐‘๐‘œ๐‘›๐‘ ๐‘œ๐‘™๐‘’ ๐‘–๐‘“ ๐‘๐‘™๐‘ข๐‘”๐‘–๐‘› ๐‘“๐‘Ž๐‘ก๐‘Ž๐‘™๐‘™๐‘ฆ ๐‘๐‘Ÿ๐‘Ž๐‘ โ„Ž๐‘’๐‘ 
#   |=> WARNING (Recommended for large and well-tested production implementations).
#   |   - ๐‡๐ข๐๐ž ๐ง๐จ๐ซ๐ฆ๐š๐ฅ ๐›๐ž๐ก๐š๐ฏ๐ข๐จ๐ฎ๐ซ. ๐‘‚๐‘›๐‘™๐‘ฆ ๐‘๐‘Ÿ๐‘–๐‘›๐‘ก ๐‘๐‘œ๐‘ก๐‘’๐‘›๐‘ก๐‘–๐‘Ž๐‘™ ๐‘–๐‘ ๐‘ ๐‘ข๐‘’๐‘ .
#   |=> INFO (Recommended for most production implementations).
#   |   - ๐๐ซ๐ข๐ง๐ญ ๐ง๐จ๐ซ๐ฆ๐š๐ฅ ๐›๐ž๐ก๐š๐ฏ๐ข๐จ๐ฎ๐ซ. ๐‘ƒ๐‘Ÿ๐‘–๐‘›๐‘ก๐‘  ๐‘๐‘œ๐‘Ÿ๐‘ก๐‘Ž๐‘™ ๐‘’๐‘ฃ๐‘’๐‘›๐‘ก๐‘  (๐‘ข๐‘ ๐‘Ž๐‘”๐‘’, ๐‘๐‘Ÿ๐‘’๐‘Ž๐‘ก๐‘–๐‘œ๐‘›, ๐‘‘๐‘’๐‘ ๐‘ก๐‘Ÿ๐‘ข๐‘๐‘ก๐‘–๐‘œ๐‘›, ๐‘’๐‘ก๐‘.)
#   |=> CONFIG (Useful for configuring preproduction instances).
#   |   - ๐๐ซ๐ข๐ง๐ญ ๐ฉ๐ž๐ซ๐ฆ๐ข๐ฌ๐ฌ๐ข๐จ๐ง ๐œ๐ก๐ž๐œ๐ค๐ฌ. ๐‘ƒ๐‘Ÿ๐‘–๐‘›๐‘ก๐‘  ๐‘โ„Ž๐‘’๐‘๐‘˜๐‘  ๐‘š๐‘Ž๐‘‘๐‘’ ๐‘ก๐‘œ ๐‘‘๐‘’๐‘ก๐‘’๐‘Ÿ๐‘š๐‘–๐‘›๐‘’ ๐‘–๐‘“ ๐‘๐‘™๐‘Ž๐‘ฆ๐‘’๐‘Ÿ๐‘  ๐‘๐‘Ž๐‘› ๐‘๐‘’๐‘Ÿ๐‘“๐‘œ๐‘Ÿ๐‘š ๐‘Ž๐‘› ๐‘Ž๐‘๐‘ก๐‘–๐‘œ๐‘›.
#   |=> FINE (Recommended for basic troubleshooting).
#   |   - ๐๐ซ๐ข๐ง๐ญ ๐ฅ๐ข๐ฆ๐ข๐ญ๐ž๐ ๐๐ž๐›๐ฎ๐  ๐ข๐ง๐Ÿ๐จ. ๐‘ƒ๐‘Ÿ๐‘–๐‘›๐‘ก๐‘  ๐‘”๐‘’๐‘›๐‘’๐‘Ÿ๐‘Ž๐‘™ ๐‘๐‘™๐‘ข๐‘”๐‘–๐‘› ๐‘’๐‘ฃ๐‘’๐‘›๐‘ก๐‘  (๐‘™๐‘œ๐‘Ž๐‘‘๐‘–๐‘›๐‘”, ๐‘‘๐‘–๐‘ ๐‘Ž๐‘๐‘™๐‘–๐‘›๐‘”, ๐‘๐‘œ๐‘›๐‘›๐‘’๐‘๐‘ก๐‘–๐‘œ๐‘›๐‘ , ๐‘’๐‘ก๐‘.).
#   |=> FINER (Recommended for some addon developers).
#   |   - ๐๐ซ๐ข๐ง๐ญ ๐ฆ๐จ๐ฌ๐ญ ๐๐ž๐›๐ฎ๐  ๐ข๐ง๐Ÿ๐จ. ๐‘ƒ๐‘Ÿ๐‘–๐‘›๐‘ก๐‘  ๐‘š๐‘’๐‘ ๐‘ ๐‘Ž๐‘”๐‘’๐‘  ๐‘‘๐‘’๐‘ก๐‘Ž๐‘–๐‘™๐‘–๐‘›๐‘” ๐‘กโ„Ž๐‘’ ๐‘๐‘™๐‘ข๐‘”๐‘–๐‘›'๐‘  ๐‘™๐‘œ๐‘”๐‘–๐‘ ๐‘Ž๐‘›๐‘‘ ๐‘๐‘’โ„Ž๐‘Ž๐‘ฃ๐‘–๐‘œ๐‘ข๐‘Ÿ.
#   |=> FINEST (Only used by StarGate's core development team).
#   |   - ๐๐ซ๐ข๐ง๐ญ ๐ž๐ฏ๐ž๐ซ๐ฒ๐ญ๐ก๐ข๐ง๐ . ๐‘ƒ๐‘Ÿ๐‘–๐‘›๐‘ก๐‘  ๐‘™๐‘–๐‘ก๐‘’๐‘Ÿ๐‘Ž๐‘™๐‘™๐‘ฆ ๐‘’๐‘ฃ๐‘’๐‘Ÿ๐‘ฆ๐‘กโ„Ž๐‘–๐‘›๐‘”, ๐‘–๐‘›๐‘๐‘™๐‘ข๐‘‘๐‘–๐‘›๐‘” ๐‘›๐‘ข๐‘š๐‘’๐‘Ÿ๐‘œ๐‘ข๐‘  ๐‘ ๐‘ก๐‘Ž๐‘๐‘˜ ๐‘ก๐‘Ÿ๐‘Ž๐‘๐‘’๐‘ .
loggingLevel: INFO
commented

[TMS 222181]
In all cases, the migrator applies an incorrect description to useRemoteDatabase,
image

commented

usingBungee is also given the wrong description.

Skjermbilde

Comparing a migrated config with the default config, there are actually a lot of inconsistencies. General Preferences is replaced with Aesthetic tweaks. The language description is missing.

Default:



# +----------------------------------------------------------------------------------------------+ #
# |                                      General Preferences                                     | #
# +----------------------------------------------------------------------------------------------+ #

# What language will stargate use when communicating with your users?
# Supported values: [en,de,nl,no,nn,sv,zh,cs,fr,tr]
#
# If SG isn't yet available in your language, please consider becoming a translator:
# https://crowdin.com/project/stargate-bukkit
language: en

bungee:
  # Are you connected to a bungee-compatible proxy?
  # Set this to true if you intend on building gates with the 'u' flag.
  usingBungee: false


  # By default, StarGate uses a local SQLite database to store its data.
  #
  # If you are running a large server, we recommend using a remote database.
  # Note that such a database is required if you intend on building gates with the 'i' flag.
  useRemoteDatabase: false

Migrated:


# SG protects gate ๐‘“๐‘Ÿ๐‘Ž๐‘š๐‘’ materials; should it also protect gate ๐‘Ž๐‘๐‘’๐‘Ÿ๐‘ก๐‘ข๐‘Ÿ๐‘’ (open/closed) materials?
# ex. in nether.gate, should nether_portal be protected?

# +----------------------------------------------------------------------------------------------+ #
# |                                       Aesthetic Tweaks                                       | #
# +----------------------------------------------------------------------------------------------+ #
language: en
bungee:

  # By default, SG will preface its remote database tables with `SG_`.
  # If this conflicts with another plugin, you can change that prefix here.
  usingBungee: false

  # An internal value used by the plugin to determine how old your config is.
  # Please do not change this.
  useRemoteDatabase: false

For some reason, it's just this section that's problematic. Everything else is fine.

commented

The migrator v.1.0.0.0. Is only used for legacy to 1.x.x, so it assumes loggingLevel is not yet an available value. For migrations from 1.0.0.0 to 1.0.0.1, a new Migrator object should be created, which is aware of all 1.0.0.0 configuration values.
The v1.0.0.0 migrator shouldn't run if a migration from legacy to 1.0.0.0 has already been run.