Skip to content

update the script based on latest login behavior#726

Draft
slickwarren wants to merge 2 commits into
rancher:mainfrom
slickwarren:cwarren/harvester/update-login-jenkinsfile
Draft

update the script based on latest login behavior#726
slickwarren wants to merge 2 commits into
rancher:mainfrom
slickwarren:cwarren/harvester/update-login-jenkinsfile

Conversation

@slickwarren

Copy link
Copy Markdown
Collaborator

after doing some debugging, it appears the login flow is broken in the jenkinsfile scripts. This PR resolves that based on the latest supported login flow from qa-infra-automation.

Copilot AI 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.

⚠️ Not ready to approve

The updated script still logs sensitive login responses (token exposure) and has reliability edge cases (infinite wait, overly strict HTTP status handling) that should be fixed before approval.

Pull request overview

This PR updates the Harvester E2E Jenkins pipeline script to align the Harvester/Rancher login and password initialization flow with the latest supported behavior, addressing a broken login flow observed during debugging.

Changes:

  • Hardened the bash login/password setup script (set -euo pipefail) and added explicit token/user-id validation.
  • Updated login calls to send JSON with the proper Content-Type header and use Authorization: Bearer for authenticated API calls.
  • Added basic HTTP-status handling for the password-set step and improved logging structure.
File summaries
File Description
validation/pipeline/tfp/Jenkinsfile.harvester.e2e Updates the Harvester/Rancher local-provider login + token usage + password initialization logic used by the Jenkins E2E pipeline.

Copilot's findings

  • Files reviewed: 1/1 changed files
  • Comments generated: 3

Note

Your feedback helps us improve the quality of this feature.
Please use 👍 or 👎 to tell us whether this assessment is correct.

Comment on lines +166 to +168
# Wait for Rancher's local auth provider to come up
until [[ "$(curl -s -L --insecure -o /dev/null -w "%{http_code}\n" "https://$inode/v3-public/localproviders/local")" == "200" ]]; do sleep 5; done
echo "https://$inode is healthy"
Comment thread validation/pipeline/tfp/Jenkinsfile.harvester.e2e Outdated
Comment thread validation/pipeline/tfp/Jenkinsfile.harvester.e2e Outdated
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
@slickwarren slickwarren force-pushed the cwarren/harvester/update-login-jenkinsfile branch from 70c869b to 11e504c Compare June 17, 2026 04:03
@slickwarren slickwarren requested a review from Copilot June 17, 2026 04:13

Copilot AI 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.

⚠️ Not ready to approve

The updated health-check loop can still hang indefinitely without a bounded timeout/retry cap, which is a reliability risk for CI execution.

Copilot's findings
  • Files reviewed: 1/1 changed files
  • Comments generated: 4

Note

Your feedback helps us improve the quality of this feature.
Please use 👍 or 👎 to tell us whether this assessment is correct.

sh '''#!/bin/bash
set -euo pipefail

export inode=$(cat host.txt)
Comment on lines +166 to +168
# Wait for Rancher's local auth provider to come up
until [[ "$(curl -s -L --insecure -o /dev/null -w "%{http_code}\n" "https://$inode/v3-public/localproviders/local")" == "200" ]]; do sleep 5; done
echo "https://$inode is healthy"
jsonOutput=$(curl --insecure -X GET -H "Accept: application/json" -H "Content-Type: application/json" -H "Authorization: Bearer $token" "https://$inode/v3/users?me=true")

echo $jsonOutput
token=$(echo "$jsonOutput" | jq -cr '.token // empty' || true)
echo "$jsonOutput"

jsonData=$( jq -n --arg password "password1234" '{"newPassword" : $password}')
userID=$(echo "$jsonOutput" | jq -cr '.data[0].id // empty' || true)
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