opencaching / opencaching-pl

The source code of Opencaching.PL (and some other domains)
https://opencaching.pl/
GNU General Public License v3.0
22 stars 33 forks source link

Refactoring attribute IDs #1251

Open andrixnet opened 7 years ago

andrixnet commented 7 years ago

I propose a more radical overhaul, that will bring consistency across OCPL and OCDE and greatly simplify exports and OKAPI and exchanging data. It requires a bit of cooperation between OCPL and OCDE developers and each node admin because there will be changes in the data.

Here is my proposal (for a complete overhaul):

The only special processing to handle OC/GC differences might be regarding the negated GC attribute to set GC specific negation with non-prefixed ID in GPX file. The introduction of in GPX export is very helpful in this regard too. All IDs documented properly at https://wiki.opencaching.eu/index.php/Cache_attributes


What does this acomplish:

  1. a consistent export of data with non-overlapping numerical identificators regardless of the source site
  2. a consistent and well documented set of data for third party application builders to rely upon
  3. a consistent export of data compatible with GC aware apps

=================================== Roadmap to acomplish this:

andrixnet commented 7 years ago

Moved here from https://github.com/opencaching/opencaching-pl/issues/1242

andrixnet commented 7 years ago

Please post this or a reference to this at OCDE development https://github.com/OpencachingDeutschland/oc-server3 , I can't do it myself.

following5 commented 7 years ago

I don't think we need to change anything at OCDE.

There are only two things were conflicts can arise between OCPL and OCDE attribute IDs:

following5 commented 7 years ago

Of course it may also break OCPL XML-interface clients if you change the IDs. But the XML-interface installations are half-broken anyway at all OCPL sites (zipping does not work due to server configuration flaws), and there may be no applications which use those IDs. At OCDE the XML interface is healthy and in use.

kojoty commented 7 years ago

BTW I've checked logs at OCPL server some time ago the only app which used our XML-interface is geokrety.org. Probably no one of us know much about this part of the code - it's not dropped yet only because of geokrety site.

following5 commented 7 years ago

Okay. geokrety.org does not need the attribute IDs.

following5 commented 7 years ago

all OC attributes that have equivalent meaning to a GC attribute to use the same numeric ID

This can change over time. E.g. GC may add the DE+PL attribute "Compass required".

all OC attributes that have equivalent meaning on both PL and DE branches to have numeric IDs in the range 1000 - 1999

That can change over time. E.g. DE may add the PL attribute "Near a Survey Marker".

How to deal with that?

following5 commented 5 years ago

There is no need to adjust OCPL <-> OCDE, because their attribute IDs will never be combined. For conflicting OCPL attributes there is issue #806.

The GC mapping problem meanwhile is solved: This mapping is active in OCPL code and OKAPI.

So I think this issue can be closed.

andrixnet commented 5 years ago

Finished collecting attribute ID information from all opencaching-pl nodes. Now working on first stage remapping.

following5 commented 5 years ago

Finished collecting attribute ID information from all opencaching-pl nodes.

I already did that. The result are here: https://github.com/opencaching/opencaching-pl/blob/master/lib/format.gpx.inc.php#L253. Especially see the UK and US mappings starting at line 363.

I hour that you are not still planning a complete renumbering of all OCPL attributes. I don't see any benefits from that. Just makes lots of work and can introduce bugs.

andrixnet commented 5 years ago

Actually exactly that, and it is a first step towards a unified attribute handling in the code. As said here, https://github.com/opencaching/opencaching-pl/issues/806#issuecomment-490364162 work is well under way. There will be SQL alters for each individual node that renumbers attributes to the same numbering. This will be documented in the common wiki (all attribs, all nodes).

Then, some attributes will be removed from various nodes and some added (US, UK, RO at least).

Then all english strings will be unified to say the same thing, based on the common documentation. (currently opencaching-pl strings say one thing, OKAPI says something else, a.s.o.).

Note: I have found a greater number of differences between nodes, not just UK/US.

It will be much easier then to write them into the code.

andrixnet commented 5 years ago

Documentation in progress.

andrixnet commented 5 years ago

Documentation ready (general form, number assignments) here: https://wiki.opencaching.eu/index.php?title=Cache_attributes

OKAPI atttribute-definitions.xml ready here https://github.com/andrixnet/okapi/commit/fe0d99673a0e709b3516cbe82b5e56cb066bbc27 (will become pull request when ready to deploy)

andrixnet commented 5 years ago

opencaching-pl code changes ready here https://github.com/andrixnet/opencaching-pl/commit/1b3b16ce16864b6e0692cede97bbfceadecbe697 (will become pull request when ready to deploy)

Database contents for each node ready here https://github.com/andrixnet/opencaching-pl/commit/7c6677837a9d538d9ce516e68cddc9ade9fd4038 (will become pull request when ready to deploy)

andrixnet commented 5 years ago

Pull requests deployed. Awaiting review and merge.