Skip to content

Feat/catalog#116

Open
matcornic wants to merge 3 commits into
golangfrom
feat/catalog
Open

Feat/catalog#116
matcornic wants to merge 3 commits into
golangfrom
feat/catalog

Conversation

@matcornic

Copy link
Copy Markdown

No description provided.

@matcornic matcornic left a comment

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Que sont ces fichiers/dossiers ? newman-docker et npm-27139-9e3ad190/registry.npmjs.org/cli-table2/-/cli-table2-0.2.0.tgz.489355601

@@ -0,0 +1,513 @@
{

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fichiers postman à mettre dans un dossier resources/postman.

@matcornic matcornic left a comment

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Je ne trouve pas d'erreur flagrantes dans ce qui est écrit, ça me parait bien.

Par contre, la validation syntaxique et sémantique des structures et sous-structures n'est quasi pas présente. Il manque toute cette partie là qui est quand même très importante.

Pour l'instant seul la vérification du format du title et l'unicité du nom ont été vérifiés en base.

Comment thread server/types/group.go
}

// Member is user whois subscribed to the groupe. His role in this group defines what he is able to do.
// Member is user who is subscribed to the groupe. His role in this group defines what he is able to do.

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

groupe -> group

return c.String(http.StatusBadRequest, fmt.Sprintf("Some fields of catalogService are not valid: %v", err))
}

// Validate fields that cIannot be validated by validator engine

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

cannot


existingCatalogServiceIDs := []bson.ObjectId{}

// Get all real groups

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

wrong comment

Comment thread server/types/catalog.go
Updated time.Time `bson:"updated" json:"updated"`
}

// NewCatalogService creates new catalogService for another one.

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

from another one

}

// Validate fields from validator tags for common types
if err := c.Validate(catalogService); err != nil {

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

On ne valide rien ici car la structure CatalogueService et toutes les sous-structures ne contient pas de flags 'validate'. Exemple : https://github.com/go-playground/validator/blob/v9/_examples/simple/main.go

Il faut valider au max ce qu'on peut avec cette librairie validate. Et pour les trucs plus compliqué, il y a la fonction en dessous.

Comment thread server/types/catalog.go
// Validate validates semantic of fields in a catalogService (like the name)
func (s CatalogService) Validate() error {

if !catalogServiceNameRegex.MatchString(s.Name) {

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Lors de la validation, on doit valider toute la structure, y compris les sous-structure.

@matcornic

Copy link
Copy Markdown
Author

Travis a cassé également :

gometalinter --vendor --deadline=60m --config=./gometalinter.json ./server/... ./cmd/... .
gometalinter: error: unknown linters: aligncheck

@codecov-io

Copy link
Copy Markdown

Codecov Report

Merging #116 into golang will decrease coverage by 0.55%.
The diff coverage is 0%.

Impacted file tree graph

@@            Coverage Diff             @@
##           golang     #116      +/-   ##
==========================================
- Coverage   46.09%   45.54%   -0.56%     
==========================================
  Files          14       14              
  Lines         909      920      +11     
==========================================
  Hits          419      419              
- Misses        465      476      +11     
  Partials       25       25
Impacted Files Coverage Δ
server/types/group.go 10.22% <ø> (ø) ⬆️
server/types/catalog.go 0% <0%> (ø) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update ca4bd8e...ff4eb03. Read the comment docs.

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.

3 participants