Skip to content

Conversation

@TheRustifyer
Copy link
Member

@TheRustifyer TheRustifyer commented Oct 31, 2022

This PR aims to:

  • Augment the code tested by increasing the number of unit tests on the project
  • Upgrade the worflows available to make it run on multiple OS and refactor certains aspects
  • Generate actions for linting (Clippy) and format code correctness (rustfmt)
  • Correct Clippy warnings
  • Format the code according rustfmt

When completed, this PR closes #22, closes #15 and closes #16

@TheRustifyer TheRustifyer self-assigned this Oct 31, 2022
@TheRustifyer TheRustifyer requested a review from gbm25 October 31, 2022 11:51
@TheRustifyer TheRustifyer marked this pull request as draft October 31, 2022 11:51
@TheRustifyer TheRustifyer force-pushed the testing/GH-15-testing-generate-the-unit-tests-necessary-to-augment-the-reliability-of-the-project branch from d3af8c4 to ff99508 Compare November 2, 2022 10:51
… with rustfmt. OS independent tests only gets triggered on push tags, just for reflecting the status badge for every new release. A new continuous-integration workflow runs now on every push and PR, being the default required statuses to pass before do anything against the main branch
@TheRustifyer TheRustifyer changed the title # Setting up testing actions and creating more unit tests for the project # Setting up testing actions, generate unit tests for the projects, correct clippy warnings and format according rustfmt Nov 2, 2022
…CRUD operation available. Corrected more Clippy warnings and formatted code with rustfmt. New shell script with alias for a better workflow on local development, and upgraded the docker-compose file with the new requeriments
@TheRustifyer TheRustifyer force-pushed the testing/GH-15-testing-generate-the-unit-tests-necessary-to-augment-the-reliability-of-the-project branch from e0f661c to a7f7749 Compare November 8, 2022 16:34
@TheRustifyer TheRustifyer force-pushed the testing/GH-15-testing-generate-the-unit-tests-necessary-to-augment-the-reliability-of-the-project branch from f991f27 to 4f05ccc Compare November 8, 2022 16:55
@TheRustifyer TheRustifyer force-pushed the testing/GH-15-testing-generate-the-unit-tests-necessary-to-augment-the-reliability-of-the-project branch from 9dbb5c6 to 97df1b1 Compare November 9, 2022 19:32
@TheRustifyer TheRustifyer force-pushed the testing/GH-15-testing-generate-the-unit-tests-necessary-to-augment-the-reliability-of-the-project branch from bc4e826 to 11f456f Compare November 10, 2022 08:56
@TheRustifyer TheRustifyer marked this pull request as ready for review November 10, 2022 17:06
@TheRustifyer TheRustifyer merged commit 42702f3 into zerodaycode:main Nov 10, 2022
TheRustifyer added a commit that referenced this pull request Dec 25, 2022
* Setted up action for autopublish tests results. Due to the incompatibility of upload-tests-results-actions with the XML output, will stay deactivated until a solution is found

* # Setting up testing actions, generate unit tests for the projects, correct clippy warnings and format according rustfmt (#21)

* #feature - setting up worflows for multiple different OS and Rust versions

* #feature - code-quality workflow for lint with Clippy, and formatting with rustfmt. OS independent tests only gets triggered on push tags, just for reflecting the status badge for every new release. A new continuous-integration workflow runs now on every push and PR, being the default required statuses to pass before do anything against the main branch

* #feature Added cache for multiple jobs on the new workflows

* #Fix - Solved clippy warnings on the project

* #feature - formatted project with rustmt

* #feature - psql docker now has config for have an static ip

* #feature - Integration Tests for the base CRUD operations available in Canyon-SQL. 

* #fix - Corrected macro paths to canyon_sql::bounds on the macro insert operations generator

* #feature - Curated the reexports for redesing the public API of the library from the  crate

* Removed the complete reexport of . Now it's reexported only the necessary elements

* #features - cleaned and upgraded the reexports of the public API. Procedures created to create tables on the SQL server client

* Trying to transmute instances of DatabaseConnection from &self obtained from the map of cached connections to &mut self

* Why tests passes?!

* Playing with the behaviour of 'block_on()' in different contexts of the framework

* Implemented the connection cache manager for every datasource

* Using the datasource variants to check against the MSSQL

* #feature - Reworked the canyon macro -> main, that now runs the custom created tokio runtime. Test macro also works with the custom runtime. The cache connections initializer now its runned inside the macros and it's allowed to be async

* #refactor - canyon_manager crate removed from the project. The manager module are now in canyon_observer, reducing project structure complexity

* [NON WORKING] - Preview of the first changes of the migrations API

* [WIP] - Mapped unordered metadata rows into one comprehensive struct

* [WIP] - Removing intermediate data structures to parse the metadata information

* Debug logs for the row retriever

* Correction over the concrete column entity generation

* Finished the refactor of the information schema parser

* Minor corrections on the memory process

* CanyonMemoryRows holds references in its process

* Canyon memory now works with both PostgreSQL and MSSQL without issues

* First refactorings of the rename tables entity name operations

* #fix - Renamed tables now are included as candidates for migrations

* Removed properties from TableMetadata that aren't relevant for the migrations process nowadays. Initialized a new tests module for the MigrationsHelper

* Debugging points for the base first operation, create or rename tables

* ALTER TABLE SqlServer version for migrations

* Reworking the constant values on the translations from Rust types to database column types

* WIP - Pursuing a .value() on a Option<String>

* #fix - Foreignkeyable refactor. The foreign key reverse lookage now receive the query parameters as &dyn QueryParameters and the query is full parametrized

* WIP - Entering on madness zone 'cause of SQL SERVER way of deleting a column

* Non hardcoded values for column names on delete defaul constraint

* Correction on the MS SQL rename table migration query. Cleaned up runtime query log of migrations query. Annotated as dead_code new written code not used yet

* Solved an issue with past changes that was a function arg that was specting &str and we change the arg type to std::String

* The QueryBuilder now has it's parameters non hardcoded as strings, are parametrized from &dyn QueryParameters

* <TypeName>Field::field_name FieldName autogenerated enum now it's able to work without manually implement the Display trait

* Small corrections

* WIP - Base implementation of the hierarchy of the diff QueryBuilder implementation types

* WIP - Megarefactor of the QueryBuilder. SelectQueryBuilder has now join operations. Removed fields from the QueryBuilder, so the sql generated by the builder method calls are directly stored in the underlying string of the Query member of the QueryBuilder. Trait bounds for the comparison operators, allowing impl Operator in method arguments

* More refactor to the QB

* Standarized the SelectQueryBuilder

* Query impl on the BaseQueryBuilder type is removed from the interface. Natural impl blocks contain now a wrapper to call the query() method on the inner QueryBuilder and query the database targeted by the specified datasource

* Update and delete operations created with the QueryBuilder got it's concrete types for themselves, with it's unique kind of operations

* Accessors (as read only member methods) and mutators (for wire user desired arbitrary data into the sql) for every concrete implementation of the querybuilder

* and_in BaseQueryBuilder method gets completed and added to the trait. BaseQueryBuilder trait get it's members documented

* BaseQueryBuilder type it's renamed to QueryBuilder, matching the QueryBuilder struct type, but encapsulated in the ops:: module

* First unit tests for the SQL generated by the builder method calls

* WIP Partial refactoring of migrations (add constraints).

Co-authored-by: Gonzalo Busto Musi <[email protected]>

* WIP Partial refactoring of migrations (logic completed but not tested).

Co-authored-by: Gonzalo Busto Musi <[email protected]>

* Added provisional conditionals on queries

Co-authored-by: Gonzalo Busto Musi <[email protected]>

* NOT WORKING - Added logs. Fix query execution.

Co-authored-by: Gonzalo Busto Musi <[email protected]>

* Fixed level of conditionals for Foreign Key comparison operations

* You're just not a Foreign Key honey, sorry about that

* Added the case to the migrations when the user desires to add or remove IDENTITY

* Migrations are now executed for every datasource designed. Pending to discard entities, or full migrations by specifying it in annotations

* Preparing the migrations for being executed by multiple datasources

* Migrations caché works now with a lazy_static HashMap that organizes the changes per datasource configured. There's no more String parsing-converison-rewiring, now it's works directly from a TokenStream

* Added more database datatypes supported on the migrations. Corrected a bug that was leading to not trigger the database column type

* WIP - The QueryBuilder tests are back. Everything works as spected but the SQLSERVER update clause. Pending to review it

* UpdateQueryBuilder<T> got finally it's owned .set(...) method to generate SET clauses. Also now is values are parametrized. Tests are reordered and fully reenabled

* Preparing the very first initial release, at version 0.0.1, which will be considered the testing crates.io version

* Every inner package specifies a version

* Added more terminal commands to the bash_aliases

* Relaxed restrictions on the type values of the second element of the tuple that are inside the array of the param columns of the set clause,there's no need to pass references

* Relaxed the mandatory until now Debug + Clone bounds on the Crud Operations proc macro. Now they're free of that restriction

* Included the repo metadata documents

* Code formatted with rustfmt

* Clippy tolds us that we could do it better, or, at least, rustier

* More format. Inserting data into MSSQL docker for the integration tests. Setting up the release action

* Upgraded docker-compose

* Solving Clippy warnings at the tests module

* Reenabling docker-compose on targets different from Linux

* Disabling integration tests for MacOS due to not docker-compose support

* IT only for Unix based systems

Co-authored-by: Gonzalo Busto Musi <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

2 participants