Skip to content
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

Codebase-operator incorrectly reports success when branch creation fails due to GitHub restrictions #65

Closed
zmotso opened this issue May 20, 2024 · 0 comments · Fixed by #66 or #67
Assignees
Labels
bug Something isn't working

Comments

@zmotso
Copy link
Contributor

zmotso commented May 20, 2024

Describe the bug
The codebase-operator is designed to automate branch creation in a Git repository. However, when GitHub's branch creation rules prevent the creation of a branch, the codebase-operator still reports the status of the codebasebranch Custom Resource (CR) as successful. This behavior is misleading and can cause confusion, as the branch has not actually been created successfully.
Acceptance Criteria:

  • When the codebase-operator attempts to create a branch in a GitHub repository and the operation is blocked by GitHub's branch creation rules, the status of the codebasebranch CR should be set to failed.
  • The failure message should clearly state that the branch creation was blocked by GitHub's branch creation rules, providing as much detail as possible to aid in troubleshooting.
  • Unit tests must be updated or added to ensure this behavior is correctly handled and to prevent regressions in future updates.
@zmotso zmotso added the bug Something isn't working label May 20, 2024
@zmotso zmotso self-assigned this May 20, 2024
@zmotso zmotso reopened this May 23, 2024
zmotso added a commit that referenced this issue May 23, 2024
This change fixes the incorrect status of the branch if
the push to the remote repository fails.
The issue was with the local working git repository.
If the push to the remote repository fails,
the second reconciliation succeeds because the local branch is created,
and the operator doesn't check whether the remote branch exists.
Added a step to clean the git working directory in case the push fails.
@SergK SergK closed this as completed in #67 May 23, 2024
SergK pushed a commit that referenced this issue May 23, 2024
This change fixes the incorrect status of the branch if
the push to the remote repository fails.
The issue was with the local working git repository.
If the push to the remote repository fails,
the second reconciliation succeeds because the local branch is created,
and the operator doesn't check whether the remote branch exists.
Added a step to clean the git working directory in case the push fails.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
1 participant