Skip to content

add the initial generated output #12

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

Merged
merged 1 commit into from
Apr 30, 2025
Merged

Conversation

gumaerc
Copy link
Contributor

@gumaerc gumaerc commented Apr 30, 2025

What are the relevant tickets?

Closes https://github.com/mitodl/hq/issues/7218

Description (What does it do?)

This PR adds missing initial generated API output so that the pipeline can successfully commit changes to it.

How can this be tested?

This code needs to be committed to main and then the pipeline needs to be run.

Copy link

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

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

Hello @gumaerc, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed!

Summary of Changes

This pull request adds the initial generated API output to the repository. It includes the base API configuration, common utilities, and index file, and it updates the OpenAPI generator version. This is to ensure that the pipeline can successfully commit changes to it.

Highlights

  • Initial API Output: The PR introduces the initial generated API output, which seems to be generated using OpenAPI Generator.
  • Version Update: The OpenAPI Generator version is updated from 7.2.0 to 7.9.0.
  • Base API Configuration: The PR adds a base.ts file, which includes the base API configuration, request arguments, and error handling.
  • Common Utilities: The PR adds a common.ts file, which includes common utilities such as setting API keys, authentication, and serializing data.
  • Configuration File: The PR adds a configuration.ts file, which defines the configuration parameters for the API.

Changelog

  • src/typescript/mitxonline-api-axios/src/v0/.openapi-generator/VERSION
    • Updated OpenAPI Generator version from 7.2.0 to 7.9.0.
  • src/typescript/mitxonline-api-axios/src/v0/base.ts
    • Added base API configuration, including BaseAPI class, RequestArgs interface, and error handling.
  • src/typescript/mitxonline-api-axios/src/v0/common.ts
    • Added common utilities for API key management, authentication, request parameter handling, and data serialization.
  • src/typescript/mitxonline-api-axios/src/v0/configuration.ts
    • Added configuration parameters for the API, including API key, username, password, access token, base path, and other options.
  • src/typescript/mitxonline-api-axios/src/v0/index.ts
    • Exported api and configuration modules.
Using Gemini Code Assist

The full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips.

Invoking Gemini

You can request assistance from Gemini at any point in your pull request via creating an issue comment (i.e. comment on the pull request page) using either /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands.

Feature Command Description
Code Review /gemini review Performs a code review for the current pull request in its current state.
Pull Request Summary /gemini summary Provides a summary of the current pull request in its current state.
Comment @gemini-code-assist Responds in comments when explicitly tagged, both in issue comments and review comments.
Help /gemini help Displays a list of available commands.

Customization

To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a .gemini/ folder in the base of the repository. Detailed instructions can be found here.

Limitations & Feedback

Gemini Code Assist is currently in preview and may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments to provide feedback.

You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension.


A new API,
Generated with care,
Ready to deploy.

Footnotes

  1. Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution.

Copy link

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

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

Code Review

This PR adds the initial generated API output for the mitxonline-api-axios library. The changes include updating the OpenAPI Generator version and adding several new files containing the generated TypeScript code. Overall, the changes seem straightforward and necessary for the pipeline to function correctly.

Summary of Findings

  • OpenAPI Generator Version Update: The update from version 7.2.0 to 7.9.0 of the OpenAPI Generator is a significant change. It's important to ensure that this update doesn't introduce any breaking changes or compatibility issues with the existing codebase or build process.
  • Generated Code Review: While the code is auto-generated, it's still important to review it for any potential issues, such as incorrect types, missing error handling, or security vulnerabilities. However, given that the code is generated, the scope of the review should be limited to identifying any obvious issues or deviations from the expected API behavior.
  • tslint and eslint Disabling: The use of /* tslint:disable */ and /* eslint-disable */ at the beginning of the generated files suppresses linting errors. While this might be acceptable for generated code, it's important to ensure that this doesn't mask any genuine issues or introduce inconsistencies in the codebase.

Merge Readiness

The PR introduces generated code, which is necessary for the pipeline to function correctly. However, due to the nature of the changes, I am unable to directly approve the pull request. It is recommended that another reviewer with expertise in the mitxonline API and the OpenAPI Generator carefully review the generated code and the impact of the version update before merging. Ensure that the pipeline runs successfully after merging these changes. Given the above findings, I recommend that the pull request not be merged until the above points are addressed.

import type { AxiosPromise, AxiosInstance, RawAxiosRequestConfig } from 'axios';
import globalAxios from 'axios';

export const BASE_PATH = "http://localhost".replace(/\/+$/, "");

Choose a reason for hiding this comment

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

medium

Consider making the BASE_PATH configurable via an environment variable or a configuration file. This would allow the API client to be used in different environments (e.g., development, staging, production) without modifying the code. This would also help facilitate testing against different environments.

export const BASE_PATH = process.env.MITXONLINE_API_BASE_PATH || "http://localhost".replace(//+$/, "");

Copy link

@jkachel jkachel left a comment

Choose a reason for hiding this comment

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

LGTM 👍

@gumaerc gumaerc merged commit 97b4d2d into main Apr 30, 2025
1 check passed
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