Skip to content

Added Git Service #3

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

Merged
merged 2 commits into from
Aug 9, 2024
Merged

Added Git Service #3

merged 2 commits into from
Aug 9, 2024

Conversation

Lucifergene
Copy link
Contributor

Test setup:

  1. Deploy to a kind cluster
make deploy
  1. Apply the ConsoleApplication YAML:
apiVersion: apps.console.dev/v1alpha1
kind: ConsoleApplication
metadata:
  name: github-successes
  namespace: avik
  labels:
    app.openshift.io/name: github-success
spec:
  applicationName: github-success-app
  git:
    url: https://github.com/openshift-console/console-application-operator
    contextDir: /
    reference: main
  importStrategy: builder-image
  buildConfiguration:
    builderImage:
      name: golang
      image: docker.io/hello/golang:latest
    buildOption: BuildConfig
    env:
      - name: hello
        value: world
  deploymentConfiguration:
    resourceType: deployment
    env:
      - name: hello
        value: world
    expose:
      targetPort: 8080
      createRoute: true
  1. Check the status of the ConsoleApplication

Signed-off-by: Lucifergene <[email protected]>
Copy link
Contributor

@mfrancisc mfrancisc left a comment

Choose a reason for hiding this comment

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

Great job 👍 I like how you structured the project and long list of functionality you added already 👏

I have left few minor comments, but I haven't yet finished reviewing the tests.

Comment on lines 69 to 71
operatorCR.Status.Conditions = make([]metav1.Condition, 0)
SetStarted(operatorCR)
if err := r.Status().Update(ctx, operatorCR); err != nil {
return RequeueWithError(err)
}
Copy link
Contributor

Choose a reason for hiding this comment

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

not sure I understand why updating the status here ? There's no condition you are setting . Are you resetting the conditions ? In that case I don't think it's needed. We can keep those there and update them only.

Copy link
Contributor Author

@Lucifergene Lucifergene Aug 5, 2024

Choose a reason for hiding this comment

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

I think it seems that I am creating an empty condition slice and updating the status with that. But the SetStarted function is adding a status condition "Progressing".

// SetStarted sets the Operator Progressing condition to True.
func SetStarted(consoleApplication *appsv1alpha1.ConsoleApplication) {
	meta.SetStatusCondition(&consoleApplication.Status.Conditions, metav1.Condition{
		Type:               appsv1alpha1.ConditionProgressing.String(),
		Status:             metav1.ConditionTrue,
		Reason:             "RequirementsBeingMet",
		LastTransitionTime: metav1.NewTime(time.Now()),
		Message:            "Requirements are being met",
	})
}

Does this work? Or am I not getting it?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Due to the complexities of having the "Progressing" status condition, I have currently moved forward with having solely the "Ready" status condition to inform users whether the application is created or is it in processing.

@mfrancisc
Copy link
Contributor

Also I see the project now allows to merge without approval. Should we configure it so that it requires one approval for merging ?

Copy link
Contributor

@mfrancisc mfrancisc left a comment

Choose a reason for hiding this comment

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

Looks great 👏 🥇

Awesome job!

@Lucifergene Lucifergene merged commit 1098d3c into main Aug 9, 2024
1 check passed
@Lucifergene Lucifergene deleted the git-service branch September 9, 2024 14:12
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.

Create the Git Service to validate Git URLs mentioned in the ConsoleApplication CR
2 participants