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

Auto-generated Pull Request for feat/content-loader #352

Merged
merged 17 commits into from
Feb 5, 2024

Conversation

github-actions[bot]
Copy link
Contributor

@github-actions github-actions bot commented Feb 2, 2024

Pulling 'feat/content-loader into develop. Please review and merge.

…reating temporary log files

The ioutil package is now deprecated in Go 1.16, and its functions have
been moved to other packages. The ioutil.TempFile function has been
replaced with os.CreateTemp. This change ensures that the code remains
up-to-date with the latest Go standards and avoids using deprecated
functions.
The addition of ContentClientKey and ContentClient constants is to
support the new content client feature in the stock center. This will
allow the application to handle content-related operations more
efficiently and in a more organized manner.
The content API client has been added to the stockcenter registry to
allow the stockcenter to interact with the content service. This change
enables the stockcenter to fetch, create, update, and delete content
data, providing a more comprehensive and integrated service.
@pull-request-size pull-request-size bot added size/S and removed size/XS labels Feb 2, 2024
…onnection

The new function SetContentAPIClient is added to establish a grpc
connection with the content grpc api server. This function takes a cli
context as an argument and uses the host and port information from the
context to dial a grpc connection. If the connection is successful, it
sets the new client in the registry. This change allows the application
to interact with the content grpc api server, enhancing its
functionality.
…ntext

The long lines of code were broken down into multiple lines to improve
readability and maintainability. This makes it easier to understand the
code and debug if necessary. The NewCliS3Client function was added to
support urfave/cli context, which provides a more flexible way to handle
command-line arguments and environment variables.
@pull-request-size pull-request-size bot added size/M and removed size/S labels Feb 2, 2024
The SetS3Client function is added to initialize the S3 client. This
function is necessary to allow the application to interact with S3
storage, which is crucial for handling file uploads and downloads. The
function takes a cli.Context as an argument, creates a new S3 client,
and sets it in the registry.
…go to logger.go for better code organization

The setupCliLogger function was moved from main.go to logger.go. This
change was made to improve code organization and maintainability. Now,
all logger related functions are in the logger.go file, making it easier
to manage and understand the code related to logging.
@pull-request-size pull-request-size bot added size/L and removed size/M labels Feb 2, 2024
…ntAPIClient functions

The new client.go file includes two functions: SetS3Client and
SetContentAPIClient. SetS3Client function is used to create a new S3
client and store it in the registry. This allows the application to
interact with S3 storage. The SetContentAPIClient function is used to
establish a connection with the content grpc api server and store the
client in the registry. This allows the application to interact with the
content grpc api server. Both functions improve the modularity and
organization of the code.
The new function ContentLoaderFlags() has been added to handle CLI
flags. This function returns an array of flags that are used to
configure the S3/Minio server, access keys, secret keys, server
endpoint, bucket details, and gRPC host and port for the content
service.
The LoadContent function has been added to the action.go file. This
function is responsible for listing and reading objects from an S3
bucket. It uses the S3 client from the registry to list objects in the
specified S3 bucket and path. For each object, it retrieves the object's
information and logs the key of the object. This function will be useful
for handling and processing data stored in S3 buckets.
…I clients

The CliSetup function has been added to initialize the S3 and ContentAPI
clients. This function is designed to streamline the setup process and
handle any errors that may occur during the initialization of these
clients. This change improves the code organization and error handling,
making the application more robust and easier to maintain.
A new command line application named 'loader' has been added. This
application is designed for loading data. It includes various flags for
setting the log level, log format, and log file. It also includes a
'content-data' command for loading content data from s3 storage.
The go-genproto, urfave/cli/v2, and xrash/smetrics dependencies have
been updated to their latest versions. This is to ensure that the
application is using the most recent features, improvements, and
security patches provided by these dependencies.
Additionally, the IBM/fp-go dependency has been added. This new
dependency provides functionality that the application needs for its
operations.
The changes include the addition of several functions to handle the
processing of content from an S3 bucket. The content is fetched, read,
and then either stored or updated in the content service. The changes
also include the addition of error handling for each step of the
process. The Slugify function was added to generate a URL-friendly slug
from the content name. This update enhances the robustness of the
content loading process and improves error handling.
}

func processS3Object(
cltx *cli.Context,
Copy link

Choose a reason for hiding this comment

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

Function processS3Object has 5 arguments (exceeds 4 allowed). Consider refactoring.

}

func storeOrUpdateContent(
client content.ContentServiceClient,
Copy link

Choose a reason for hiding this comment

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

Function storeOrUpdateContent has 5 arguments (exceeds 4 allowed). Consider refactoring.

…ding

The ioutil package is being phased out as of Go 1.16, and its
functionality has been provisioned in other packages like os and fs.
This change replaces ioutil with os and fs for directory reading in the
NewPlasmidSeqReader function. Additionally, error handling has been
added for file info retrieval to ensure the program doesn't crash when
it encounters an error while retrieving file information.
…on from v1.52.2 to v1.55.2

The Go version and linter version have been updated to keep the project
up-to-date with the latest tools and features. This ensures that the
project is using the most recent improvements and bug fixes from these
tools, which can help to improve the quality of the code and reduce
potential issues.
…nt function

The unused variable 'sct' was removed to clean up the code and improve
readability. The error message was added to the error formatting in both
'storeOrUpdateContent' and 'createStoreContent' functions to provide
more detailed error information, which will help in debugging and error
tracking.
Copy link

codeclimate bot commented Feb 5, 2024

Code Climate has analyzed commit fdf63d0 and detected 0 issues on this pull request.

View more on Code Climate.

@cybersiddhu cybersiddhu added the automerge automerge pull request label Feb 5, 2024
@kodiakhq kodiakhq bot merged commit d8af37d into develop Feb 5, 2024
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
automerge automerge pull request size/L
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant