Skip to content
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

Feature/227 #229

Merged
merged 88 commits into from
Jan 18, 2023
Merged

Feature/227 #229

merged 88 commits into from
Jan 18, 2023

Conversation

IshikaGopie
Copy link
Contributor

  • Please check if the PR fulfills these requirements
  • The commit message follows our guidelines
  • Tests for the changes have been added (for bug fixes / features)
  • Docs have been added / updated (for bug fixes / features)
  • What kind of change does this PR introduce? (Bug fix, feature, docs update, ...)

  • What is the current behavior? (You can also link to an open issue here)

  • What is the new behavior (if this is a feature change)?

  • Does this PR introduce a breaking change? (What changes might users need to make in their application due to this PR?)

  • Other information:

* Switched to directly using the model projections interface (instead of the projections.Projection)
* Updated the middleware interface signature to have EntityRepository (removed Projection, EventRepository, EntityFactory)
* Removed default controllers (since they are going to be reworked anyway in #209)
* Removed default middleware (since they are going to be reworked anyway in #209)
* Created Function to get repository from context
* Moved EntityFactory to interfaces.go file
* Impelmented EntityRepository on GORMDB
* Small updates to get end2end to run
* Removed httpClient object form RESTAPI
* Updated mocks
* Added documentation for the WeOS initialization etc
* Updated StandardInitializer
* Deprecated stanard controllers and middleware
… with the method as the key

* Removed unused middleware and controllers from controller_standard.go
* Moved the command resolution outside of the echo handler so it's only done once (instead of on every request)
* Removed initializers that setup middleware that was removed
# Conflicts:
#	controllers/rest/controller_standard.go
* Removed CreateBatch handler (this will now be handled by the Create receiver)
* EventRepository is no longer passed in from the controller. It's instead pulled from the container in the receiver
* Updated the command signature such that the entity repository is passed in and an interface was added to the command dispatch return (this is to avoid having to do an extra query in the controller, also to facilitate id generation in the receiver)
* Updated mocks because of the update to the command signature
* Updated the create handler in a basic way
* Update the delete handler in a basic way
* Update the update hanlder in a basic way
* Added container mock in the model package since the event repository is retrieved from the container and the receiver will need to mock the container. Note that it was not added to the other mocks_test.go because that is used to make mocks in other packages and would cause a conflict if copied to the weos_mocks_test.go
* Added sequence no. to delete command factory
* Added a bit of documentation for repository
* Added methods to EntityRepository interface for deleting and generatingID (and updated the mocks accordingly)
* Updated receivers to try to get entity using entity id if available otherwise use the identifier from the entity
* Updated GORMDB repository to implement new EntityRepository methods
…Initializer

* Created factory method for GORMRepository
* Updated event store to get entitytype from entity if it's a content entity
* Added a separate List Controller
* Created utility to get the requested content type based on the "Accept" header (need to add code to process priority)
* Added code to parse the response configuration and setup serving files, templates, and folder
* Moved the static render code outside the request handler
* Updated gorm extension to marshal a property that is an array or object that references a schema that is marked as inline with the x-inline extension
* Made it so that an error is thrown when a property that references an inline model is processed as a gorm model (when this happens it is treated as a string)
* Updated content entity to parse strings for inline schemas so they are returned correctly
* Made a few related schemas inline
* Updated what is returned when a handler panics a bit to try to get more info
* Made it so that properties that are referencing inline schemas can also be null
* Added weos_id and sequence no. to the payload so that it could be persisted correctly
* Added integration test for inline schema
# Conflicts:
#	model/mocks_test.go
akeemphilbert and others added 22 commits October 10, 2022 13:07
…deployed to the server

* Added debug message when user is blocked from a path
* Updated the signature for SQLConnectionFromConfig to return the connection string to make it more testable
* Added two variable to the DB config, one for specifying that IAM is to be used and the other for the AWS Region
* Added InvalidAWSDriver error to be used when an incompatible driver is specified

switch config.Driver {
case "mysql":
connStr = fmt.Sprintf("%s:%s@tcp(%s)/%s?tls=true&allowCleartextPasswords=true",
Copy link
Contributor

Choose a reason for hiding this comment

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

you're essentially creating your own connection string for mysql but it doesn't account for the parameters that are needed to get the mysql stuff working with GORM see the mysql connection string connStr = fmt.Sprintf("%s:%s@tcp(%s:%s)/%s?sql_mode='ERROR_FOR_DIVISION_BY_ZERO,NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION'&parseTime=true",

…t are needed to get the mysql working with GORM
@akeemphilbert akeemphilbert merged commit c9e52fa into dev Jan 18, 2023
@akeemphilbert akeemphilbert deleted the feature/227 branch January 18, 2023 14:04
IshikaGopie added a commit that referenced this pull request Jun 12, 2023
…ctions are not closed due to a connection's idle time
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.

2 participants