Skip to content

Console

Console entrypoint for Review Assist.

prompt_user_for_token(dependencies)

Prompts the user to input a GitLab token if it is not already provided.

This function checks whether the required GitLab token is present in the dependencies container and prompts the user if it is missing. The provided token is stored securely in the dependencies container. The function is designed to interact with the user through the console.

Parameters:

Name Type Description Default
dependencies Container

A container that holds the application's dependencies, including the GitLab token.

required

Raises:

Type Description
RAConsoleError

If the user interrupts the token input process.

resolved_locations_message(configuration, log_file_location)

Display the resolved configuration location and log file location.

show_current_python()

Display the current Python version.

verify_review_prerequisite(args, dependencies)

Verify that the required arguments are provided and a private token is set.

welcome_message()

Display a welcome message with the application version.

Console handler for review operations.

review_handler(args, changes_service)

Handles merge request reviews using provided arguments and changes service.

It validates the required inputs before initiating the review process for the specified project and merge request. Each review step is executed for a predefined set of work types, and the corresponding review is displayed in the user's console in addition to being posted to the MR.

Parameters:

Name Type Description Default
args Namespace

The arguments passed to the review handler, containing the project and change request details.

required
changes_service ChangesCommand

The service used to perform the review operation.

required

show_review(review)

Display the review in the console as rendered Markdown.

Module for displaying to the console the current configuration.

fill_table(table, data)

Fills the provided table with data and returns the updated table.

The function takes an existing Table instance and uses the provided data to populate it with rows containing section names, option keys, and their corresponding values. Each section from the input data is iterated through, and its options and values are added as rows in the table. Styles can be seen in the formatting of the columns.

Parameters:

Name Type Description Default
table Table

The table instance to populate with data.

required
data dict[str, dict[str, str]] | ConfigParser

A dictionary, where keys are section names and values are dictionaries of options and their corresponding values. Alternatively, a ConfigParser instance can be provided directly.

required

Returns:

Name Type Description
Table Table

The modified table with additional rows based on the input data.

show_current_config(cfg)

Displays the current configuration in a formatted table.

This function provides a visual representation of the given configuration data by printing it to the console in a formatted table. It uses the provided configuration object to gather and display the information.

Parameters:

Name Type Description Default
cfg Configuration

The configuration object containing data to be displayed.

required

Returns:

Type Description
None

None

Module to show to the console the system health status.

show_status(system)

Display system health status.

Module to show version information in the console.

show_version()

Display version information.