Skip to content

Import and export rules from the web UI#327

Merged
tmcgilchrist merged 2 commits intoocurrent:masterfrom
MisterDA:je-suis-dans-l-import-export
Apr 22, 2022
Merged

Import and export rules from the web UI#327
tmcgilchrist merged 2 commits intoocurrent:masterfrom
MisterDA:je-suis-dans-l-import-export

Conversation

@MisterDA
Copy link
Copy Markdown
Contributor

@MisterDA MisterDA commented Apr 7, 2022

Allows to import (by a CSV file upload) and export rules (to a CSV
file) from the web UI. For now, uploading doesn't work as I'm not sure
how to correctly retreive the file data, and more importantly I can't
figure out why file file upload always errors with "Bad CSRF" (help
would be appreciated).

Sub-question: do we want to "atomically" import all rules, i.e. should
we validate the whole file before adding rules, or install rules but
retract installed rules if there's an error down the line, or just gather
errors as I've done?

@MisterDA MisterDA requested a review from tmcgilchrist April 7, 2022 17:33
@MisterDA MisterDA force-pushed the je-suis-dans-l-import-export branch from 9d38596 to f6bb436 Compare April 7, 2022 17:37
@tmcgilchrist
Copy link
Copy Markdown
Member

Importing atomically seems the right option and clearly report which rules failed the validation.
e.g. regex invalid or duplicate rule

@MisterDA MisterDA force-pushed the je-suis-dans-l-import-export branch 3 times, most recently from 77b4033 to 234c7e7 Compare April 11, 2022 22:13
@MisterDA MisterDA marked this pull request as ready for review April 11, 2022 22:14
@tmcgilchrist
Copy link
Copy Markdown
Member

tmcgilchrist commented Apr 12, 2022

Looks like a good start, the exporting works nicely.

Could you hide the import / export based on the user being logged in?

Screen Shot 2022-04-12 at 16 33 02

@MisterDA MisterDA force-pushed the je-suis-dans-l-import-export branch from 234c7e7 to 6f7fa47 Compare April 12, 2022 11:38
@MisterDA
Copy link
Copy Markdown
Contributor Author

The last commit should do the trick but I don't like much. It'd be better if resources could export the required role to access them, but I keep fighting the typesystem over objects.

@MisterDA MisterDA force-pushed the je-suis-dans-l-import-export branch from a25cb95 to 9662bf3 Compare April 21, 2022 11:26
@tmcgilchrist tmcgilchrist merged commit 98b9bea into ocurrent:master Apr 22, 2022
tmcgilchrist added a commit to tmcgilchrist/opam-repository that referenced this pull request Jun 2, 2022
…, current_github, current_git, current_examples, current_docker and current (0.6.1)

CHANGES:

Web UI:

- UI restyle, embed files using ocaml-crunch. (@ewanmellor, @MisterDA, ocurrent/ocurrent#315)

- Automatically refresh some pipeline pages. (@MisterDA, ocurrent/ocurrent#227)

- Allow to import and export using CSV the log rules. (@MisterDA, ocurrent/ocurrent#327)

- Log matcher takes the pattern with the highest score (@kit-ty-kate, ocurrent/ocurrent#335)

API:

- GitHub: Add pp_short for commit and fix url link for GH commits. (@tmcgilchrist, ocurrent/ocurrent#347)

- GitHub: Fetch commit messages for commits on GitHub (@punchagan, ocurrent/ocurrent#337)

- GitHub: Add Current_github.Api.cmdliner_opt. (@dra27, ocurrent/ocurrent#338)

- GitHub: Add extra PR information to Ref.t (@tmcgilchrist @TheLortex, ocurrent/ocurrent#336)

Plugins:

- GitLab: support GitLab clone fork and fetch MR branch. (@MisterDA, ocurrent/ocurrent#346)

- Git: Fix handling of git repositories with submodules. (@talex5, ocurrent/ocurrent#345)

- GitLab: Fix ref filtering bug for GitLab (@tmcgilchrist, ocurrent/ocurrent#332)

Other:

- Add missing dependencies on Unix (@dra27, ocurrent/ocurrent#331)
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.

2 participants