benoitdm-oslandia / pg_featureserv

Apache License 2.0
1 stars 0 forks source link

Feature/replace feature - [merged] #102

Closed benoitdm-oslandia closed 1 year ago

benoitdm-oslandia commented 1 year ago

In GitLab by @azarz on Sep 9, 2022, 10:09

_Merges feature/replacefeature -> develop

ref #23 et #21

benoitdm-oslandia commented 1 year ago

In GitLab by @azarz on Sep 9, 2022, 16:01

added 1 commit

Compare with previous version

benoitdm-oslandia commented 1 year ago

In GitLab by @azarz on Sep 9, 2022, 17:36

added 1 commit

Compare with previous version

benoitdm-oslandia commented 1 year ago

In GitLab by @azarz on Sep 9, 2022, 17:55

added 2 commits

Compare with previous version

benoitdm-oslandia commented 1 year ago

In GitLab by @azarz on Sep 9, 2022, 21:59

Les tests ne passent pas à cause de leur ordre de lancement...

benoitdm-oslandia commented 1 year ago

In GitLab by @azarz on Sep 9, 2022, 22:16

added 1 commit

Compare with previous version

benoitdm-oslandia commented 1 year ago

In GitLab by @azarz on Sep 9, 2022, 22:48

added 1 commit

Compare with previous version

benoitdm-oslandia commented 1 year ago

In GitLab by @azarz on Sep 9, 2022, 22:52

added 1 commit

Compare with previous version

benoitdm-oslandia commented 1 year ago

In GitLab by @azarz on Sep 10, 2022, 24:36

added 2 commits

Compare with previous version

benoitdm-oslandia commented 1 year ago

In GitLab by @azarz on Sep 10, 2022, 24:36

J'ai trouvé une incohérence entre la base de données de tests et le catalogue. Dans le catalogue, les ID des features sont des String, alors que dans la base de données de test, ce sont des SERIAL (int). Du coup les tests sont différents pour le catalogue ou pour la BDD, ce qui n'est pas normal je pense...

https://git.oslandia.net/Client-projects/geoplateforme-ign-pg-featureserv/-/blob/develop/internal/data/catalog.go#L114 https://git.oslandia.net/Client-projects/geoplateforme-ign-pg-featureserv/-/blob/develop/util/test_db.go#L55

https://git.oslandia.net/Client-projects/geoplateforme-ign-pg-featureserv/-/merge_requests/11/diffs?commit_id=a4245bcac627bff2d1a79f6cb61f5051a335cd07#3f82e2d4db76dbf6b4a5336696c1f108fc41216f_157_158

benoitdm-oslandia commented 1 year ago

In GitLab by @azarz on Sep 10, 2022, 24:47

added 1 commit

Compare with previous version

benoitdm-oslandia commented 1 year ago

In GitLab by @azarz on Sep 10, 2022, 24:51

marked this merge request as ready

benoitdm-oslandia commented 1 year ago

In GitLab by @azarz on Sep 10, 2022, 01:16

added 1 commit

Compare with previous version

benoitdm-oslandia commented 1 year ago

si tu rebases tu verras qu'il y a une nouvelle variable featureId qui fait tout ca

benoitdm-oslandia commented 1 year ago

Je ne me souviens plus de ce qu'on avait dit mais je ne vois pas d'obligation dans la spec de retourner du 200 + content. Si il n'y a pas d'obligation, je suggère qu'on se limite au 204.

benoitdm-oslandia commented 1 year ago

Nos tests sont trop simples et ne permettent pas de tester tous les types possibles (bool, decimal, entier, geometrie, etc.).

benoitdm-oslandia commented 1 year ago

Est ce que ca ne serait pas plus simple de récupérer l'objet en base directement après l'update ?

benoitdm-oslandia commented 1 year ago

Unable to replace new feature in Collection new ?

benoitdm-oslandia commented 1 year ago
            case "create", "replace":
                // The "replace" schema is identical to the "create" schema.
                // http://docs.ogc.org/DRAFTS/20-002.html#feature-geojson
                return writeCreateItemSchemaJSON(ctx, w, tbl)
benoitdm-oslandia commented 1 year ago

bizarre que ca apparaisse dans tes commits. Ca aurait venir avec le rebase

benoitdm-oslandia commented 1 year ago

pareil : "bizarre que ca apparaisse dans tes commits. Ca aurait venir avec le rebase"

benoitdm-oslandia commented 1 year ago

pareil

benoitdm-oslandia commented 1 year ago

ne fonctionnera plus dès qu'on va augmenter la taille de l'api

benoitdm-oslandia commented 1 year ago

ajout inutile

benoitdm-oslandia commented 1 year ago

pareil que plus haut: "bizarre que ca apparaisse dans tes commits. Ca aurait venir avec le rebase"

benoitdm-oslandia commented 1 year ago

@azarz bien :thumbsup: , ca m'a fait voir qq points qu'on pourrait améliorer (comme les types des objets qu'on teste). Sinon je pense qu'il y a eu un mixe étrange avec des commits de la MR de @lowzonenose

benoitdm-oslandia commented 1 year ago

In GitLab by @azarz on Sep 12, 2022, 10:53

Commented on internal/api/openapi.go line 527

Dans Zoom j'avais posé la question et on n'avait pas dit ça image

benoitdm-oslandia commented 1 year ago

In GitLab by @azarz on Sep 12, 2022, 10:57

Commented on internal/api/openapi.go line 527

D'autant plus que pour le UPDATE, c'est la même chose dans la doc de l'OGC, et pour l'instant seul le 200 était documenté. Il faudra être cohérent là dessus

benoitdm-oslandia commented 1 year ago

In GitLab by @azarz on Sep 12, 2022, 11:00

Commented on internal/data/catalog_db.go line 370

C'est ce que je fais via le RETURNING, mais le problème c'est que le id est retourné dans la propriété properties de la feature.

J'ai essayé d'utiliser les fonctions pour récupérer un objet en base (TableFeature() notamment), mais elles prennent en argument un *QueryParams, auxquel on n'a pas accès dans la méthode ReplaceTableFeature()

De plus si on décide de renvoyer un 204 vide, cette partie du code n'aura plus beaucoup d'intérêt...

benoitdm-oslandia commented 1 year ago

In GitLab by @azarz on Sep 12, 2022, 11:01

Commented on internal/api/api.go line 92

erreur de copier coller, je vais régler ça

benoitdm-oslandia commented 1 year ago

In GitLab by @azarz on Sep 12, 2022, 11:02

added 1 commit

Compare with previous version

benoitdm-oslandia commented 1 year ago

In GitLab by @azarz on Sep 12, 2022, 11:03

Commented on internal/service/handler.go line 554

pour les trucs du genre : quand j'ai fait un rebase il y a eu beaucoup de conflits avec les modifs de JP : git n'arrivait pas à bien faire le diff (comme lors de mon premier rebase). Je pense que ça vient de là

benoitdm-oslandia commented 1 year ago

In GitLab by @azarz on Sep 12, 2022, 11:03

Commented on internal/service/handler_test.go line 490

changed this line in version 12 of the diff

benoitdm-oslandia commented 1 year ago

In GitLab by @azarz on Sep 12, 2022, 11:03

added 1 commit

Compare with previous version

benoitdm-oslandia commented 1 year ago

en effet, je n'ai été très clair et je n'ai pas réagi à ce qu'à fait @lowzonenose : je préférerais qu'on se cantonne au 204 sans retour de data supplémentaire (que je trouve inutile).

benoitdm-oslandia commented 1 year ago

Si on reste sur du 204 donc en effet cette partie devient inutile

benoitdm-oslandia commented 1 year ago

In GitLab by @azarz on Sep 12, 2022, 11:12

added 23 commits

Compare with previous version

benoitdm-oslandia commented 1 year ago

In GitLab by @azarz on Sep 12, 2022, 11:12

marked this merge request as draft from 46bd5564a5ca9417c7b541f5cb990dc9204bccac

benoitdm-oslandia commented 1 year ago

In GitLab by @azarz on Sep 12, 2022, 11:14

Commented on internal/api/openapi.go line 527

OK noté

benoitdm-oslandia commented 1 year ago

In GitLab by @azarz on Sep 12, 2022, 12:00

Commented on internal/api/openapi.go line 499

changed this line in version 14 of the diff

benoitdm-oslandia commented 1 year ago

In GitLab by @azarz on Sep 12, 2022, 12:00

Commented on internal/api/openapi.go line 527

changed this line in version 14 of the diff

benoitdm-oslandia commented 1 year ago

In GitLab by @azarz on Sep 12, 2022, 12:00

Commented on internal/data/catalog_db.go line 370

changed this line in version 14 of the diff

benoitdm-oslandia commented 1 year ago

In GitLab by @azarz on Sep 12, 2022, 12:00

Commented on internal/api/api.go line 92

changed this line in version 14 of the diff

benoitdm-oslandia commented 1 year ago

In GitLab by @azarz on Sep 12, 2022, 12:00

Commented on internal/service/handler_put_test.go line 39

changed this line in version 14 of the diff

benoitdm-oslandia commented 1 year ago

In GitLab by @azarz on Sep 12, 2022, 12:00

added 1 commit

Compare with previous version

benoitdm-oslandia commented 1 year ago

In GitLab by @azarz on Sep 12, 2022, 12:36

added 1 commit

Compare with previous version

benoitdm-oslandia commented 1 year ago

In GitLab by @azarz on Sep 12, 2022, 14:39

added 1 commit

Compare with previous version

benoitdm-oslandia commented 1 year ago

In GitLab by @azarz on Sep 12, 2022, 14:42

marked this merge request as ready

benoitdm-oslandia commented 1 year ago

approved this merge request