-
Notifications
You must be signed in to change notification settings - Fork 489
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
dynamic cockpit link resolution via well known endpoint #4297
Conversation
Open tasks
|
@AlexanderSkrock Any blockers that you encountered working on this solution? We're happy to assist where needed. |
Hi @nikku , thank you for asking! I appreciate your assistance as always! Right now, there are no blockers except that I currently have no spare time due to private circumstances. Tho, I think I'll be able to follow up in a couple weeks. As this did not appear to be a priority topic, I did not give a sign myself. Kind regards |
Hi @nikku , finally, I was able to come back to this topic! From the implementation side, I would say it is complete and working. I would like to extend the documentation now, but I am not quite sure where to put it. I was able to locate the Camunda Desktop Modeler documentation within the camunda-docs repo . I could add it below the start instance picture here, but it would not be as obvious for someone specifically looking for such a feature. Do you have any ideas? Maybe I overlooked a section. Kind regards |
cf5293a
to
eaf2653
Compare
Hi @AlexanderSkrock, Thanks for your contribution, and sorry for a delay in review. I noticed that the PR is failing on CI due to a linting problem. Can you please fix it so that we can verify the tests pass? |
Hi @barmac , thank you for the response! I was on vacation the previous week anyways. Did you see my question / thoughts about documentation changes? Kind regards |
8c6c3ca
to
344b6c3
Compare
I rebased my branch once again onto the current development branch, so feel free to review now, @barmac . Also, all tests passed on my fork's actions. |
I am going to look into this today. |
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.
Hi, this PR is bigger than what I'd expect because of the refactorings included. Please have a look at the comments that I left, and hopefully we should be able to merge this soon. Thanks again for your contribution.
async getAdminUrl() { | ||
const { | ||
admin | ||
} = await this.getWellKnownWebAppUrls(); |
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.
If I understand it correctly, we request the well known API each time we try to check each of the application's url. Is this necessary?
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.
Yes, this is correct. Of course, we could cache the response, but then again, we need to think about when to clear the cache. Because it should not change except for development purposes I could think of a internal map structure within the WellKnownApi file. This "cache" would be evicted on a reload via dev tools or on restarting the Camunda Desktop Modeler.
How important would caching be for you? And if it was preferred, would cache evict on restart be sufficient?
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 think it's OK if it does not slow down the flow too much. The deployment does not happen all the time anyway...
instance.isOnBeforeSubmit = true; | ||
|
||
wrapper.update(); | ||
setTimeout(() => { |
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 understand that the current test suite for the deployment tool is in bad shape, but I'd rather expect us to properly make use of act
and waitFor
instead of introducing more setTimeout
calls. Let's not make the tests depend on the time.
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 am not sure about the Formik workaround with the isOnBeforeSubmit
flag which seems to stop working as soon as I replace setTimeout
.
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 managed to get this working now, but I had to introduce a new dependency @testing-library/react
so we have those calls available.
client/src/plugins/camunda-plugin/shared/ui/CockpitProcessInstanceLink.js
Outdated
Show resolved
Hide resolved
client/src/plugins/camunda-plugin/shared/ui/CockpitDeploymentLink.js
Outdated
Show resolved
Hide resolved
const cockpitUrl = await forEngineRestUrl(engineUrl).getCockpitUrl(); | ||
|
||
if (cockpitUrl) { | ||
console.debug(`Using cockpit url from well known endpoint: ${engineUrl}`); |
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'd rather use debug
dependency consistently instead of console.debug
which is the same as console.log
.
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 exchanged those calls.
Please don't mind the failing CI job for ubuntu/pull_request. This is happening because a community PR does not have access to the secrets. |
Hi @barmac , |
Hi @barmac , could you please have a look on the changes / my answers to the open discussion again? It's been some time and I'd personally love to know whether there are any open tasks for me. Kind regards |
Sorry, I was off when you wrote this. I will have a look this week. |
client/src/plugins/camunda-plugin/deployment-tool/__tests__/DeploymentConfigOverlaySpec.js
Outdated
Show resolved
Hide resolved
Unfortunately, this is now failing on the CI. Can you please have a look @AlexanderSkrock? |
Good catch about the missing
I am not entirely sure about the reasons, but the submit simulation was wrapped inside Kind regards |
bf24fb5
to
d1fc373
Compare
Thanks, let's check if it works again on CI. I am aware that we may experience some flakiness in the deployment component, but it should not always fail until we fix it. |
OK it works (ignore the import secrets failure). We will merge this within a couple of days as we are now in the code freeze. Thank you for your PR! |
The main problems before were stubbing away the well known api dependency as well as shallow rendering for the notification.
Co-authored-by: Maciej Barelkowski <maciejbarel@gmail.com>
Co-authored-by: Maciej Barelkowski <maciejbarel@gmail.com>
I just squashed and merged this contribution. Thank you @AlexanderSkrock! |
Aims to fix: #4261
Requirements for this functionality were discussed here: #4261 (comment)