Skip to content

Add methods to use the BTP CLI #5305

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

Open
wants to merge 9 commits into
base: master
Choose a base branch
from

Conversation

Dannick-debug
Copy link

@Dannick-debug Dannick-debug commented Mar 27, 2025

Pull Request Description

Objective

This pull request introduces functions to facilitate the use of the BTP CLI. The key functionalities added include:

  • Connecting to the BPI Cockpit (login/logout)
  • Creating, retrieving, and deleting service instances
  • Creating, retrieving, and deleting service bindings

Key Improvements

  • CommandBuilder Implementation: A CommandBuilder has been developed to streamline script creation, ensuring efficient command handling.
  • Execution Mechanisms: Two execution mechanisms have been introduced:
    • Synchronous Execution (Run): Enables concurrent task execution without blocking the main process.
    • Asynchronous Execution (RunSync): Incorporates a polling mechanism to verify the success of BTP actions at regular intervals.

Synchronous Execution

Currently, BTP actions do not support direct synchronous execution. To address this, a polling mechanism has been implemented to continuously check the status of actions, ensuring they are completed successfully.

Checklist

  • Tests: Comprehensive tests have been conducted to ensure functionality and reliability.

Copy link

cla-assistant bot commented Mar 27, 2025

CLA assistant check
Thank you for your submission! We really appreciate it. Like many open source projects, we ask that you sign our Contributor License Agreement before we can accept your contribution.
You have signed the CLA already but the status is still pending? Let us recheck it.

Copy link
Member

@DanielMieg DanielMieg left a comment

Choose a reason for hiding this comment

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

Reviewed Authentication.go - will do the rest later.
I gave a little bit of feedback regarding the structure. It would be good to think about the loggedIn boolean again.

@DanielMieg DanielMieg requested a review from doldsimo March 31, 2025 09:53
@DanielMieg DanielMieg requested review from o-liver, tiloKo and a team April 28, 2025 13:32
@Dannick-debug Dannick-debug changed the title Replace cf cli with btp api Add methods to use the BTP CLI Apr 30, 2025
@Dannick-debug Dannick-debug marked this pull request as ready for review April 30, 2025 07:47
@Dannick-debug Dannick-debug requested a review from a team as a code owner April 30, 2025 07:47
@o-liver o-liver requested a review from srinikitha09 April 30, 2025 09:43
@o-liver
Copy link
Member

o-liver commented Apr 30, 2025

So this is a fist step, right? And then in another PR you will introduce the corresponding steps that consume this, or put an option into the cf deploy, and other cf steps, to use btp cli instead of cf cli?

@o-liver
Copy link
Member

o-liver commented Apr 30, 2025

Currently we provide the cf-cli with this docker image: https://github.com/SAP/devops-docker-cf-cli

Will you provide a docker image for the btp cli as well, or what is the plan?

@Dannick-debug
Copy link
Author

So this is a fist step, right? And then in another PR you will introduce the corresponding steps that consume this, or put an option into the cf deploy, and other cf steps, to use btp cli instead of cf cli?

Yes exactly it is the first step. In another PR we will then:

  • introduce the consumption of these functions in the different steps.
  • And also introduce an additional option in the different steps to choose between CF or BTP.

@Dannick-debug
Copy link
Author

Currently we provide the cf-cli with this docker image: https://github.com/SAP/devops-docker-cf-cli

Will you provide a docker image for the btp cli as well, or what is the plan?

Thank you for bringing this up! Currently, our focus is on delivering the essential components in Golang for the BTP CLI. While we aren't providing a Docker image ourselves, team members who utilize these functions or steps will have the ability to create their own custom Docker environment if required.

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.

3 participants