Skip to content

fix: [BAS][Deploy] Password field in the deploy page disappears when the user edits the username.#4934

Merged
avasilev-sap merged 7 commits into
mainfrom
fix/4932/deploy-auth-form
Jul 17, 2026
Merged

fix: [BAS][Deploy] Password field in the deploy page disappears when the user edits the username.#4934
avasilev-sap merged 7 commits into
mainfrom
fix/4932/deploy-auth-form

Conversation

@avasilev-sap

@avasilev-sap avasilev-sap commented Jul 13, 2026

Copy link
Copy Markdown
Contributor

#4932

Description

  • Fixes a bug in the BAS deploy page where the password field disappears when a user edits the username after a successful login.
  • Fix additional issues with the login form. If by default no auth system is selected, e.g. xyz_noath then we select xyz_basic(already authenticated) and then select again xyz_auth then the login form disappears. This happen because the provider related to the system is cached and points out the auth system.
  • Make possible to login with different credentials on the same system multiple times. This is a real use case imagine we want to switch to a user with elevated permissions.

Root Cause

The showPasswordQuestion() condition was tied to transportConfigNeedsCreds, which gets reset to false after successful log in (so downstream questions like package/transport can appear). This caused the password field to vanish as soon as the username was modified, after authentication completed.

Changes

  • conditions.ts: Introduced a new areCredentialFieldsVisible flag in PromptState.transportAnswers that is set when credentials are needed but is not cleared by validateCredentials. showPasswordQuestion() now uses this flag instead of transportConfigNeedsCreds.

  • types.ts: Added the areCredentialFieldsVisible optional property to the TransportAnswers interface.

  • abap-service-provider.ts: Refactored getOrCreateServiceProvider to create a new service provider when the same system is called with different credentials (e.g., when the user changes their username). Previously, the cached provider was always reused if the system matched, even with new credentials. Added a private areCredentialsProvided() helper method and consolidated the provider selection logic.

  • system-utils.ts (new file): Extracted system comparison logic into reusable utilities isValidSystemConfig and areSystemConfigEquals with proper URL normalization (trims whitespace, removes trailing slashes).

  • utils.ts: Removed the now-replaced isSameSystem function.

  • Tests: Added/updated unit tests for the new behavior, including scenarios for credential re-entry and system config equality.

Type of change

  • Bug (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds a new feature)
  • Breaking change (Bug or New feature that would cause existing functionality/consumers to not work as expected)
  • Non-Breaking chores (Changes to tools, libraries, build process, documentation, etc)
  • None of the above (Reviewers might ask for more clarification)

How have you tested?

  • Unit tests added for system-utils.ts (isValidSystemConfig, areSystemConfigEquals)
  • Updated abap-service-provider tests to verify credential-based provider recreation and caching behavior
  • Updated conditions.test.ts to use areCredentialFieldsVisible flag

Checklist:

  • The code conforms to the general development principles

  • Supplied as many details as possible on this change

  • The code is easy to read and maintainable by others

  • Corresponding changes to the documentation has been done

  • Already existing and new unit tests pass locally

  • 🔄 Regenerate and Update Summary

PR Bot Information

Version: 1.27.6

  • Output Template: Repository PR Template
  • Summary Prompt: Default Prompt
  • Event Trigger: pull_request.opened
  • Correlation ID: 7591e130-7e89-11f1-8304-972930cda22b
  • File Content Strategy: Full file content
  • LLM: anthropic--claude-4.6-sonnet

…uld be displayed. The previously used flag has other meaning and is misused.

* Chnage the behaviour of getOrCreateServiceProvider(). In case the method is called with credentials we always get a fresh provider instance not a cached one.
* Fix an issue with the getSystemConfig - the backendTarget is always ignoired since the PromptState.abapDeployConfig is always an object. We return the config in the promot state only if it is a valid one otherwise we return the provided backednTarget.
…redentials prompt appear when the xyz is selected without auth for the second time. This is because both xyz_basic and xyz_noauth represent the same system and use the cached provider for the auth system (xyz_auth). The comparator used to determine the equality of two systems is wrong it disregards the destination.

* Fix chageset summary.
@changeset-bot

changeset-bot Bot commented Jul 13, 2026

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: 93de460

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 6 packages
Name Type
@sap-ux/abap-deploy-config-inquirer Patch
@sap-ux/abap-deploy-config-sub-generator Patch
@sap-ux/create Patch
@sap-ux/deploy-config-sub-generator Patch
@sap-ux/ui-service-inquirer Patch
@sap-ux/ui-service-sub-generator Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@cianmSAP cianmSAP left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Code updates look ok
Manually tested, appears to work as expected with improvements as described in bug

@nikmace nikmace left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Changes look good
Changeset is OK
Coverage is good
Did not test manually

@sonarqubecloud

Copy link
Copy Markdown

@avasilev-sap
avasilev-sap merged commit ff7fc25 into main Jul 17, 2026
18 checks passed
@avasilev-sap
avasilev-sap deleted the fix/4932/deploy-auth-form branch July 17, 2026 12:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants