Skip to content
This repository has been archived by the owner on Oct 4, 2019. It is now read-only.

feat(ODC-466): add status variables to GitSource API type #9

Merged

Conversation

MatousJobanek
Copy link
Contributor

Adds status variables to GitSource API type to be able to keep information about the state fo the CR and if the last connection attempt was successful or not.
The initializing is when the GitSource was tested for the connectivity but the user hasn't finished the UI wizard of importing/creating the GitSource. Old GitSources with this state are ready to be garbage collected.
Ready are those whose creation was completed

Copy link
Member

@alexeykazakov alexeykazakov left a comment

Choose a reason for hiding this comment

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

Code wise looks good overall (besides const & var). But the generated code needs some fix.

pkg/apis/devconsole/v1alpha1/gitsource_types.go Outdated Show resolved Hide resolved
pkg/apis/devconsole/v1alpha1/gitsource_types.go Outdated Show resolved Hide resolved
pkg/apis/devconsole/v1alpha1/gitsource_types.go Outdated Show resolved Hide resolved
pkg/apis/devconsole/v1alpha1/gitsource_types.go Outdated Show resolved Hide resolved
@@ -25,94 +25,17 @@ import (
)

// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
func (in *Component) DeepCopyInto(out *Component) {
Copy link
Member

Choose a reason for hiding this comment

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

You are removing deep copy for Component API? Make sure you have the latest master in your local repo when regenerating deep copy. It looks like it's missing Component API.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

because I generated the code within the git-service repository and I didn't copy the component_types.go there.

The user experience is terrible - copy from types from api repo to operator repo to generate code that is needed in git-service repo. So then copy the generated code to git-service and every time when any type is changed copy it back to operator repo, regenerate and copy back... and then, finally, copy the resulting code to api repo...

Copy link
Member

Choose a reason for hiding this comment

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

Yeah... It's not very dev friendly flow :) Maybe we should add some make targets to help with some tasks (like copying stuff around and cleaning it up with package replacement). Or another option would be just to merge everything to one mono repo ;)
But for now we just need to make sure we run make generate in devconsole-api repo after all these dance with moving apis.

"github.com/redhat-developer/devconsole-api/pkg/apis/devconsole/v1alpha1.GitSource": schema_pkg_apis_devconsole_v1alpha1_GitSource(ref),
"github.com/redhat-developer/devconsole-api/pkg/apis/devconsole/v1alpha1.GitSourceSpec": schema_pkg_apis_devconsole_v1alpha1_GitSourceSpec(ref),
"github.com/redhat-developer/devconsole-api/pkg/apis/devconsole/v1alpha1.GitSourceStatus": schema_pkg_apis_devconsole_v1alpha1_GitSourceStatus(ref),
"github.com/redhat-developer/git-service/pkg/apis/devconsole/v1alpha1.GitSource": schema_pkg_apis_devconsole_v1alpha1_GitSource(ref),
Copy link
Member

Choose a reason for hiding this comment

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

Wrong package.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

When I regenerated the API within the devconsole-operator repo, then this change disappeared. In addition, the component API is missing there as well.
Btw, @sbose78 why is the component_types.go (and the whole apis directory) present in the devconsole-operator repo at all. And with different content than in the api repo? It brings to the whole generate/copy/paste flow additional complications.

Copy link
Member

Choose a reason for hiding this comment

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

It will be moved out in the next couple of days :)

alexeykazakov and others added 5 commits April 9, 2019 12:12
Co-Authored-By: MatousJobanek <matousjobanek@gmail.com>
Co-Authored-By: MatousJobanek <matousjobanek@gmail.com>
Co-Authored-By: MatousJobanek <matousjobanek@gmail.com>
Co-Authored-By: MatousJobanek <matousjobanek@gmail.com>
@MatousJobanek MatousJobanek merged commit 15eec3f into redhat-developer:master Apr 10, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants