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

feat: get namespaces owned only when fork a project #2187

Merged
merged 2 commits into from
Dec 23, 2022

Conversation

andre-code
Copy link
Contributor

@andre-code andre-code commented Dec 5, 2022

PR to fetch namespaces owned only for fork and create projects.
Pending:

  • Fix e2e tests

/deploy #persist #cypress renku=renku-ui-2.15.0-tests

closes #2027

@andre-code andre-code temporarily deployed to renku-ci-ui-2187 December 5, 2022 10:49 Inactive
@RenkuBot
Copy link
Contributor

RenkuBot commented Dec 5, 2022

You can access the deployment of this PR at https://renku-ci-ui-2187.dev.renku.ch

Base automatically changed from 2157-fix-fork-components to master December 5, 2022 17:43
@andre-code andre-code force-pushed the 2027-create-project-only-owner-namespaces branch from 0733fdb to 5f0c894 Compare December 5, 2022 19:23
@andre-code andre-code temporarily deployed to renku-ci-ui-2187 December 5, 2022 19:23 Inactive
@andre-code andre-code temporarily deployed to renku-ci-ui-2187 December 8, 2022 10:09 — with GitHub Actions Inactive
@andre-code andre-code force-pushed the 2027-create-project-only-owner-namespaces branch from 5f0c894 to 3a52f26 Compare December 8, 2022 18:56
@andre-code andre-code force-pushed the 2027-create-project-only-owner-namespaces branch from 3a52f26 to db37f7a Compare December 8, 2022 18:57
@andre-code andre-code temporarily deployed to renku-ci-ui-2187 December 8, 2022 18:57 — with GitHub Actions Inactive
@andre-code andre-code force-pushed the 2027-create-project-only-owner-namespaces branch from db37f7a to ea6ad9a Compare December 9, 2022 07:26
@andre-code andre-code temporarily deployed to renku-ci-ui-2187 December 9, 2022 07:27 — with GitHub Actions Inactive
@andre-code andre-code force-pushed the 2027-create-project-only-owner-namespaces branch from ea6ad9a to 414c581 Compare December 9, 2022 07:51
@andre-code andre-code temporarily deployed to renku-ci-ui-2187 December 9, 2022 07:52 — with GitHub Actions Inactive
@andre-code andre-code force-pushed the 2027-create-project-only-owner-namespaces branch from 414c581 to b8a9832 Compare December 9, 2022 08:08
@andre-code andre-code temporarily deployed to renku-ci-ui-2187 December 9, 2022 08:09 — with GitHub Actions Inactive
@andre-code andre-code changed the title WIP feat: get namespaces owned only when fork a project feat: get namespaces owned only when fork a project Dec 9, 2022
@andre-code andre-code marked this pull request as ready for review December 9, 2022 08:35
@andre-code andre-code requested a review from a team as a code owner December 9, 2022 08:35
@andre-code andre-code temporarily deployed to renku-ci-ui-2187 December 9, 2022 08:35 — with GitHub Actions Inactive
Copy link
Member

@lorenzo-cavazzi lorenzo-cavazzi left a comment

Choose a reason for hiding this comment

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

This looks good!
I suggest using a wrapper instead of creating the old "NewProjectCoordinator" in other contexts for the time being -- I added a description inline but I'm also happy to implement it if the comment is not clear.

I've noticed a detail with visibilities: when creating a new project, while re-computing the available visibilities, it doesn't show the temporary loader. The behavior is correct on the Fork tho.
I added a gif to explain it better (the comparison is PR vs DEV since I didn't notice it was already working well on forks also in the PR)

Peek 2022-12-09 11-29

P.S. the local e2e tests are failing; it's probably necessary to update them.

Comment on lines 117 to 119
coordinator={
new NewProjectCoordinator(
props.client, props.model.subModel("newProject"), props.model.subModel("projects"))}
Copy link
Member

Choose a reason for hiding this comment

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

I understand the reason for this, but it feels a bit weird importing and creating the NewProjectCoordinator here in the App (or in the AddDatasetNewProject section).
What about adding a temporary wrapper?
This would mean creating a class NewProjectWrapper in the "ProjectNew.coordinator.js" file that takes the props, create the coordinator and passes it as a prop to the functional component. And that can be exported as export { NewProjectWrapper as NewProject}
That way, once we remove the wrapper, we don't need to modify the code wherever we use NewProject but just clean up the "ProjectNew.coordinator.js" content.
P.S: I realize this is harder to explain than to implement. I'm happy to push a commit with this change.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

sure, added the wrapper

warnings["namespace"] = "Fetching namespaces...";

if (meta.namespace.fetching)
if (projects && projects.fetching)
warnings["title"] = "Fetching projects to avoid duplicated projects...";
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
warnings["title"] = "Fetching projects to avoid duplicated projects...";
warnings["title"] = "Fetching projects to prevent duplicates...";

Copy link
Contributor

@ciyer ciyer left a comment

Choose a reason for hiding this comment

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

This looks very good! When reviewing the code, I noticed a couple of small things. The first one was there before your code, but since we are making changes, I think it would make sense to improve.

client/src/project/new/ProjectNew.state.js Outdated Show resolved Hide resolved
@lorenzo-cavazzi
Copy link
Member

Another detail: could you incorporate the fix to the getSlugAndReset function from here? #2209

It's just a tiny change, from this line

return ${creation.newNamespace}/${creation.newName};

to this line

return ${creation.newNamespace}/${creation.newNameSlug};

@andre-code andre-code force-pushed the 2027-create-project-only-owner-namespaces branch from b8a9832 to 88c9cfd Compare December 12, 2022 14:38
@andre-code andre-code temporarily deployed to renku-ci-ui-2187 December 12, 2022 14:38 — with GitHub Actions Inactive
@andre-code
Copy link
Contributor Author

thanks team for your review, I added all your suggestions 💪

@andre-code andre-code temporarily deployed to renku-ci-ui-2187 December 12, 2022 15:14 — with GitHub Actions Inactive
@andre-code andre-code temporarily deployed to renku-ci-ui-2187 December 13, 2022 07:35 — with GitHub Actions Inactive
@ciyer ciyer force-pushed the 2027-create-project-only-owner-namespaces branch from 708f2a4 to 4f3d061 Compare December 19, 2022 11:41
@ciyer ciyer temporarily deployed to renku-ci-ui-2187 December 19, 2022 12:10 — with GitHub Actions Inactive
@ciyer ciyer temporarily deployed to renku-ci-ui-2187 December 19, 2022 13:00 — with GitHub Actions Inactive
@ciyer ciyer temporarily deployed to renku-ci-ui-2187 December 19, 2022 13:40 — with GitHub Actions Inactive
@ciyer ciyer force-pushed the 2027-create-project-only-owner-namespaces branch from 3bf9751 to d941deb Compare December 20, 2022 09:26
@ciyer ciyer force-pushed the 2027-create-project-only-owner-namespaces branch from d941deb to 883a712 Compare December 20, 2022 09:27
@ciyer ciyer temporarily deployed to renku-ci-ui-2187 December 20, 2022 09:27 — with GitHub Actions Inactive
@ciyer ciyer force-pushed the 2027-create-project-only-owner-namespaces branch from 883a712 to a14ca85 Compare December 22, 2022 09:39
@ciyer ciyer temporarily deployed to renku-ci-ui-2187 December 22, 2022 09:40 — with GitHub Actions Inactive
@ciyer ciyer temporarily deployed to renku-ci-ui-2187 December 22, 2022 11:33 — with GitHub Actions Inactive
@ciyer ciyer temporarily deployed to renku-ci-ui-2187 December 22, 2022 12:35 — with GitHub Actions Inactive
@ciyer ciyer temporarily deployed to renku-ci-ui-2187 December 22, 2022 16:27 — with GitHub Actions Inactive
@ciyer ciyer temporarily deployed to renku-ci-ui-2187 December 23, 2022 07:25 — with GitHub Actions Inactive
@ciyer ciyer force-pushed the 2027-create-project-only-owner-namespaces branch from a14ca85 to 64d948d Compare December 23, 2022 08:44
@ciyer ciyer temporarily deployed to renku-ci-ui-2187 December 23, 2022 09:32 — with GitHub Actions Inactive
@ciyer ciyer temporarily deployed to renku-ci-ui-2187 December 23, 2022 10:51 — with GitHub Actions Inactive
@ciyer ciyer temporarily deployed to renku-ci-ui-2187 December 23, 2022 11:04 — with GitHub Actions Inactive
@ciyer ciyer temporarily deployed to renku-ci-ui-2187 December 23, 2022 11:22 — with GitHub Actions Inactive
@ciyer ciyer force-pushed the 2027-create-project-only-owner-namespaces branch from 64d948d to e9b4ab1 Compare December 23, 2022 12:40
@ciyer ciyer temporarily deployed to renku-ci-ui-2187 December 23, 2022 12:47 — with GitHub Actions Inactive
@ciyer ciyer deployed to renku-ci-ui-2187 December 23, 2022 13:43 — with GitHub Actions Active
Copy link
Contributor

@ciyer ciyer left a comment

Choose a reason for hiding this comment

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

The changes look good! There were some problems with the tests because the test user had thousands of projects and some of the actions were taking longer now, but those problems have now been fixed.

@andre-code andre-code merged commit 8b27b82 into master Dec 23, 2022
@andre-code andre-code deleted the 2027-create-project-only-owner-namespaces branch December 23, 2022 14:22
@RenkuBot
Copy link
Contributor

Tearing down the temporary RenkuLab deplyoment for this PR.

@ciyer ciyer mentioned this pull request Feb 8, 2023
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.

when creating renku project, groups where user is "Direct Member" are shown, and only those
5 participants