Fix workload identity project updates#16373
Fix workload identity project updates#16373melissalkelly wants to merge 2 commits intoansible:develfrom
Conversation
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (1)
📝 WalkthroughWalkthroughChanges to Changes
Estimated code review effort🎯 2 (Simple) | ⏱️ ~12 minutes 🚥 Pre-merge checks | ✅ 2 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (2 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
68b9920 to
ce5e7bf
Compare
|
PabloHiro
left a comment
There was a problem hiding this comment.
LGTM, I think it can be merged as is, but some clarification on the change might be helpful.
| passwords['scm_key_unlock'] = project_update.credential.get_input('ssh_key_unlock', default='') | ||
| passwords['scm_username'] = project_update.credential.get_input('username', default='') | ||
| passwords['scm_password'] = project_update.credential.get_input('password', default='') | ||
| if self.instance: |
There was a problem hiding this comment.
I am quite sure whoever reads this in 1 month is gonna struggle to understand this chunk of code, so I think it is worth putting a comment. Thoughts?
| if self.instance: | |
| # Retrieve in-memory project_update.credential that has its context populated. | |
| # Fallback to the DB resource if not available. | |
| if self.instance: |



SUMMARY
Fix workload identity credentials for project updates with non-insights SCM types.
Project updates using OIDC workload identity credentials (e.g., retrieving git passwords from HashiCorp Vault) were failing with "Token, Username/Password, AppRole, Kubernetes, or TLS authentication parameters must be set" because:
build_credentials_list()only returned credentials forscm_type == 'insights', preventingpopulate_workload_identity_tokens()from generating tokens for git/svn/archive projectsbuild_passwords()usedproject_update.credential(fresh DB instance without context) instead of the credential fromself._credentials(which contains the populated workload identity token context)Changes:
RunProjectUpdate.build_credentials_list()self._credentialsinRunProjectUpdate.build_passwords()to preserve the token contextISSUE TYPE
COMPONENT NAME
STEPS TO REPRODUCE AND EXTRA INFO
See AAP-67476 for details and linked testing PR
Summary by CodeRabbit