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

Pulling feat/action-workflow into develop #161

Merged
merged 24 commits into from
Aug 11, 2023
Merged

Conversation

github-actions[bot]
Copy link

No description provided.

The .kodiak.toml file is added to the repository to configure the
behavior of the Kodiak CI tool. This file specifies the version of the
configuration, sets up automatic merging of pull requests labeled with
"dependencies" or "automerge", and defines the merge method as "rebase".
It also configures automatic merging of PRs opened by the "dependabot"
user that are "minor" or "patch" version upgrades, while ignoring
"major" version upgrades. Additionally, it specifies that the
"dependabot" user should be ignored when using the `update.always`
option to allow dependabot to update and close stale dependency
upgrades.
The .opencommitignore file is added to the repository to exclude the
go.sum file from being committed. This is done to prevent unnecessary
changes to the go.sum file from cluttering the commit history.
…al linters and adjust their settings

The linters configuration in the .golangci.yml file has been updated to
enable additional linters and adjust their settings. The following
changes were made:
- Added linters: asciicheck, bidichk, cyclop, decorder, dogsled, errname, godot, gocognit, gomnd, gomoddirectives, gomodguard, grouper, importas, maintidx, nestif, nilerr, nlreturn, nolintlint, prealloc, revive, rowserrcheck, thelper, tparallel, unconvert, unparam, varnamelen, wastedassign, wrapcheck.
- Adjusted settings for the funlen linter: lines limit set to 80 and statements limit set to 50.
- Adjusted settings for the lll linter: line length limit set to 130.
- Adjusted settings for the revive linter: added a rule for var-naming with an argument of [["ID"]].
- Adjusted settings for the gosec linter: excluded rule G404.
- Adjusted settings for the wrapcheck linter: ignored specific function signatures.

These changes were made to improve the code quality and maintainability of the project by enforcing additional linting rules and adjusting existing ones to better fit the project's requirements.
The GitHub Actions workflow for linting has been updated to use the
latest versions of the actions/checkout and actions/setup-go actions.
The go-version has been set to '1.20' and caching has been disabled.
Additionally, the action-golangci-lint action has been replaced with the
golangci/golangci-lint-action action, using version v1.52.2.
…v2 to v3 for improved functionality and stability

The actions/checkout version has been updated from v2 to v3 to ensure
improved functionality and stability.
…ons, and codecov-action version

The GitHub Actions workflow file has been updated to use the latest
versions of the setup-go and checkout actions. The setup-go action now
uses go-version '~1.20.6' to ensure compatibility with the desired Go
version. The checkout action has been updated to version 3.
Additionally, the codecov-action has been updated to version 3.
…ant value

The import paths for the grpc middleware packages have been updated to
improve readability and maintainability of the code. The import path for
the dat and runner packages has been fixed to resolve compilation
errors. The variable name "ms" has been fixed to "nrs" to match the
actual variable name. The constant name "ExitError" has been fixed to
"ExitError" to match the actual constant name. The function name
"RunServer" has been fixed to "runServer" to follow Go naming
conventions. The error code has been fixed from 2 to ExitError to match
the constant value. The error message formatting for the content
microservice registration error has been fixed. The error code has been
fixed from 2 to ExitError to match the constant value. The error message
formatting for the failed to listen error has been fixed. The error code
has been fixed from 2 to ExitError to match the constant value. The
error message for the error in running cmux server has been fixed.
…ncy with naming conventions

The import paths for the dat and sqlx-runner packages have been updated
to use the v2 versions. The ExitError constant value has been changed
from ExitError to 2 to improve consistency. The setApiHost function has
been renamed to setAPIHost to follow the naming conventions. The
getPgxDbHandler function parameter has been renamed from c to cltx for
clarity.
@codecov
Copy link

codecov bot commented Aug 10, 2023

Codecov Report

❗ No coverage uploaded for pull request base (develop@4600176). Click here to learn what that means.
The diff coverage is 69.64%.

Impacted file tree graph

@@            Coverage Diff             @@
##             develop     #161   +/-   ##
==========================================
  Coverage           ?   67.47%           
==========================================
  Files              ?        1           
  Lines              ?      289           
  Branches           ?        0           
==========================================
  Hits               ?      195           
  Misses             ?       73           
  Partials           ?       21           
Files Changed Coverage Δ
server/content.go 67.47% <69.64%> (ø)

…gxDbHandler function

The getPgxDbHandler function now returns an error if there is an issue
opening the database connection. This ensures that any errors
encountered during the database connection process are properly handled.
Additionally, the getLogger function has been refactored to use the cltx
variable instead of c for improved clarity and consistency.
… for better readability and maintainability

The server.go file has been refactored to improve the readability and
maintainability of the code. The server startup logic has been moved
into a separate function called startServers, which takes care of
starting the gRPC and HTTP servers. This improves the organization of
the code and makes it easier to understand the server startup process.
Additionally, support for customizing HTTP headers and methods in the
CORS configuration has been added. The CORS configuration now allows for
any origin, credentials, and a list of allowed methods including GET,
POST, PUT, DELETE, OPTIONS, and PATCH. This provides more flexibility in
handling cross-origin requests.
…eMux function

The createHTTPServeMux function no longer requires a parameter as it
does not use it.
…ener function

The createListener function now returns an error if there is an issue
creating the net.Listener. This ensures that any errors encountered
during the creation of the listener are properly handled. In the
RunServer function, the parameter name has been changed from c to clt
for clarity and to improve readability.
…ndling

The HTTP server in the startServers function now includes a
ReadHeaderTimeout of 10 seconds to prevent hanging connections.
Additionally, the error handling has been improved by closing the error
channel when the maximum number of errors is reached. The addition of
the Timeout constant allows for easy configuration of the timeout value.
…matting and readability

The code in the content.go file has been reformatted to improve
readability and maintainability. Line breaks and indentation have been
added to make the code more structured and easier to understand. This
will make it easier for developers to work with and maintain the code in
the future.
The attrTodbContent function is no longer used in the codebase and has
been removed to improve code cleanliness and maintainability.
…HandleError() functions in wrapcheck linter

The .golangci.yml file has been modified to add exceptions for the
.HandleMessagingError() and .HandleError() functions in the wrapcheck
linter. This change allows these functions to be used without triggering
linting errors.
…istsResource, getResource, and getResourceBySlug functions

The nolint comments are added to ignore the errcheck lint warnings for
the SetTrailer and AutoRollback function calls. This is done to improve
code readability and avoid unnecessary noise in the codebase.
The existsResource, getResource, and getResourceBySlug functions are
refactored to improve error handling and provide more informative error
messages. This helps in better understanding and debugging of potential
issues related to database queries.
…handling in NewRequest, UserRequest, and UserRequestWithContext functions

The code in req.go has been reformatted to improve readability. Error
handling has been added in the NewRequest, UserRequest, and
UserRequestWithContext functions to provide more informative error
messages when there are connection or encoding errors.
The changes in content_test.go include removing an unused import and
variable declaration, fixing a typo in the fakeRequest struct
definition, removing an unnecessary empty fakeRequest struct definition,
and fixing error handling in the NewTestPostgresFromEnv,
cloneDbSchemaRepo, and runGRPCServer functions.
The fakeRequest struct is no longer used in the code, so it has been
removed to improve code readability and maintainability. The pg variable
in the NewTestPostgresFromEnv function has been renamed to pgt to
improve clarity and avoid confusion with the TestPostgres struct. The
net.Listen function call in the runGRPCServer function has been modified
to include the "localhost" prefix to ensure the server listens on the
correct address. Lastly, a typo in the TestDelete function name has been
fixed to ensure the test is executed correctly.
…statements to handle errors gracefully

The log.Fatalf calls in the TestMain function have been changed to
log.Printf to avoid terminating the test execution. Return statements
have been added after logging the errors to gracefully handle the errors
and continue with the test execution.
…tter readability

The exit error code is now extracted into a constant named ExitError to
improve code readability and maintainability.
…n error

The code now includes error handling for the app.Run() function. If an
error occurs during the execution of the command, it will be logged
using the log.Fatalf() function and the program will exit.
@cybersiddhu cybersiddhu merged commit f30db58 into develop Aug 11, 2023
4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant