Conversation
There was a problem hiding this comment.
Pull request overview
This PR modifies the connection info handling logic in the challenge deployment process. Previously, existing connection info in challenge.yml was preserved and took precedence over deployment results. Now, deployment results always override existing connection info when provided, ensuring accuracy and preventing stale connection info from being used across events.
- Changes the precedence order so deployment-returned connection info always takes priority
- Updates user messaging to indicate when connection info is being updated
- Ensures connection info is only set to None when neither the deployment nor existing challenge provides it
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| # If no connection_info was provided by the challenge | ||
| # and the deployment didn't result in one either, just ensure it's not present | ||
| elif not challenge_instance.get("connection_info"): |
There was a problem hiding this comment.
This condition should always execute when deployment_result.connection_info is falsy (line 757). The elif will never be reached when there's existing connection_info in challenge_instance and no deployment connection_info, leaving stale connection_info in place. Consider using 'else:' or explicitly checking 'if not deployment_result.connection_info:'.
| # If no connection_info was provided by the challenge | |
| # and the deployment didn't result in one either, just ensure it's not present | |
| elif not challenge_instance.get("connection_info"): | |
| # If no connection_info was provided by the deployment, just ensure it's not present | |
| else: |
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Always save connection info in challenge.yml if returned by the deployment handler.
If a deployment returns a
connection_infostring - it's guaranteed to be correct, and we should override the currentconnection_info. This prevents a case where leftover (e.g. from a previous event)connection_infostrings are set during another even because they were saved inchallenge.yml.