-
Notifications
You must be signed in to change notification settings - Fork 29
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
Gitops GitHub create wizard #36
Gitops GitHub create wizard #36
Conversation
Signed-off-by: Abinand P <[email protected]>
Signed-off-by: Abinand P <[email protected]>
Signed-off-by: Abinand P <[email protected]>
Signed-off-by: Abinand P <[email protected]>
Signed-off-by: Abinand P <[email protected]>
Signed-off-by: Abinand P <[email protected]>
Signed-off-by: Abinand P <[email protected]>
Signed-off-by: Abinand P <[email protected]>
Signed-off-by: Abinand P <[email protected]>
@quest-bot loot #19 |
Quest PR submitted!@Abiji-2020, you are attempting to solve the issue and loot this Quest. Will you be successful? Questions? Check out the docs. |
@Abiji-2020, it looks good at first sight; thanks for your contribution. To continue with a more detailed review, I will ask you to proceed with the following:
Please let me know when you're done, and I'll proceed with more detailed review. |
Update Lint Command
…l use the default account stored. Signed-off-by: Abinand P <[email protected]>
…i-2020/permit-cli into gitops-github-create-wizard
The copy SSH key stage is very clunky -
|
@gemanor I have modified, to use the API Key either from the command line as option. and if it is not given, we will take it the default API value stored in keychain. example |
I have edited out the newlines and copying to clipboard is necessary? If wanted let me add it too |
…ew line Signed-off-by: Abinand P <[email protected]>
It should use the |
Also, @Abiji-2020, I'm trying to run the tests locally, but couldn't. Please merge from Main, fix all the lint errors, and ensure the test is passing. |
Another issue is the follwoing error that I get when running it:
|
This issue is that keytar is missing right? UPDATE: I cannot reproduce this issue, could give me the steps to reproduce? |
Signed-off-by: Abinand P <[email protected]>
@gemanor apologies, as I haven't added the test to the scripts which are added now, and in the linting it shows warnings of the empty dependencies in useEffect, as I wanted to call them only once, I have used an empty array (to call them when only mounted). and the option If we use the argument There are some existing errors in https://github.com/permitio/permit-cli/blob/main/test.tsx |
What version of Node.js are you using? |
Works for me now. Will do CR soon. Can you tell me what do you mean by |
Signed-off-by: Abinand P <[email protected]>
@gemanor Apart from the permit-cli/source/commands/pdp/run.tsx Lines 17 to 22 in f70b563
In this we are making permit-cli/source/commands/gitops/create/github.tsx Lines 92 to 94 in 52d466b
{ state === 'apiKey' && (<AuthProvider>
{ const {authToken} = useAuth();
setApiKey(authToken);
setState('project');
}
</AuthProvider>)
} |
Signed-off-by: Abinand P <[email protected]>
We don't have now "parent" component, so you need to wrap the GitHub create command, and encapsulate its functionality that needs the API key to components. |
I am unable to grasp the things, could you elaborate more @gemanor , and instead of auth provider can't we use Lines 50 to 65 in f70b563
which simplifies and also gets the APIkey from Keychain.
Since AuthProvider also provides the same way permit-cli/source/components/AuthProvider.tsx Lines 26 to 34 in f70b563
|
…Token() Signed-off-by: Abinand P <[email protected]>
The intent to use the AuthProvider, is to make its logic shared across components, so we can later extend its functionality with other stuff. The load is a util function, not logical function. |
So shall I create a new file with the complete github component and have an encapultate in the command similar to how we have exactly in https://github.com/permitio/permit-cli/blob/main/source/commands/pdp/run.tsx ? @gemanor |
…o created a new component Signed-off-by: Abinand P <[email protected]>
@gemanor I have added the |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I tested the flow and it's not working. Please fix that (or report errors if there are any).
Also, left some other comments. Please address them.
…nd also modified the changes requested Signed-off-by: Abinand P <[email protected]>
Signed-off-by: Abinand P <[email protected]>
yeah it is broken in the |
….json Signed-off-by: Abinand P <[email protected]>
Now I get an error when trying to save:
|
@gemanor again i tested my workflow it seems just to be working fine. could you give me more info on this? |
Okay, the problem is the browser login flow. It works only with key, let me try to fix that. Another problem, is handling error with activate call. Even when it's succeed, it gets error after saving. |
@gemanor I think we need to delay the activate component a little bit as, when i try to activate it immediately it showed me error but for the same when i paused for a minute and then try to activate it, it worked. |
The logic should be a little different. The policy repository is on status of It is not about delaying in 1 minute; it is about waiting for the repository status to be valid. We can solve it with two options, the first is the easiest IMO:
Again, IMO, removing the activate step and instead use argument to disable the |
…ted in the payload Signed-off-by: Abinand P <[email protected]>
@gemanor I have modified the code to go with the option1 flow |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice work!
@gemanor could you check on the quest loot is not yet released for this ? |
🧚 @Abiji-2020 congratulations for completing Quest #19 💰 A reward of $300 has been credited to you. To claim your $300 reward follow the instructions here. Questions? Check out the docs. |
Created the complete GitOps flow for GitHub
closes #19
@quest-bot loot #19
Test Coverage
Demo video
Permit-gitops.flow.test.mp4