-
Notifications
You must be signed in to change notification settings - Fork 3
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
UPPSF-1150 Refactored project #35
UPPSF-1150 Refactored project #35
Conversation
powerslider
commented
Feb 20, 2020
- Integrated go modules
- Extracted constants to yaml configuration
- Restructured project with a proper cmd/pkg structure
- Set proper visibility to all structs and interfaces
- Fixed tests to comply with the new structure
- Added new UPPLogger
- Extracted client and server HTTP boilerplate outside of main.go
- Added docker-compose.yml and Makefile
- Integrated go modules - Extracted constants to yaml configuration - Restructured project with a proper cmd/pkg structure - Set proper visibility to all structs and interfaces - Fixed tests to comply with the new structure - Added new UPPLogger - Extracted client and server HTTP boilerplate outside of main.go - Added docker-compose.yml and Makefile
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Besides the order of imports. Just one more thing regarding the project's structure:
packages like es mapper and/or mapper should/could it be a subpackages of the same one ? (just out of curiosity)
@@ -75,4 +75,4 @@ Shows ES cluster health details | |||
## Other information | |||
An example of event structure is here [testdata/exampleEnrichedContentModel.json](messaging/testdata/exampleEnrichedContentModel.json) | |||
|
|||
The reference mappings for Elasticsearch are found here [runtime/referenceSchema.json](runtime/referenceSchema.json) | |||
The reference mappings for Elasticsearch are found here [configs/referenceSchema.json](configs/referenceSchema.json) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
missing updates: tests no longer are used with vendor (?); missing info regarding the logger;
refer : https://github.com/Financial-Times/upp-schema-reader/blob/master/README.md; https://github.com/Financial-Times/public-lists-api/blob/master/README.md
cmd/content-rw-elasticsearch/main.go
Outdated
@@ -1,36 +1,24 @@ | |||
package main | |||
|
|||
import ( | |||
"net" | |||
"net/http" | |||
"github.com/Financial-Times/content-rw-elasticsearch/pkg/concept" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
imports order; As noted above having a linter that checks the format helps a lot;
https://github.com/Financial-Times/upp-coding-standard
docker-compose.yml
Outdated
driver: local | ||
|
||
networks: | ||
common: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
missing eol.
pkg/config/config.go
Outdated
|
||
import ( | ||
"fmt" | ||
"github.com/Financial-Times/content-rw-elasticsearch/pkg/schema" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
imports order
package es | ||
|
||
import ( | ||
"encoding/json" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
imports order
HTTPClient *http.Client | ||
Checks []fthealth.Check | ||
AppSystemCode string | ||
log *logger.UPPLogger |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
is there a reason log not to be public ? (just an opinion)
test/helper.go
Outdated
log.Fatal(err) | ||
} | ||
return content | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
missing eol
package message | ||
|
||
import ( | ||
"encoding/json" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
imports order
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We should remove the failing Snyk checks and use the golang-ci
orb in order do run a Snyk scan.
bd36972
to
62449e0
Compare
…dredd config in circleci
62449e0
to
0dd44eb
Compare
7e59fb5
to
fd01324
Compare
- Removed unneeded mutexes - Added install target in Makefile for installing statik circleci - Deleted generated statik binary which will now be generated only before build - Renamed test/data to test/testdata to ignore being detected from go tooling - Added statik as an external dependency to Dockerfile and circleci config
fd01324
to
bd4437e
Compare
424f670
to
ecc308c
Compare
…mod=readonly to go lisst command
ecc308c
to
c0b18bd
Compare