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(boards2): implement next boards version - WIP #2901

Draft
wants to merge 78 commits into
base: master
Choose a base branch
from

Conversation

ilgooz
Copy link
Contributor

@ilgooz ilgooz commented Oct 4, 2024

No description provided.

@github-actions github-actions bot added the 🧾 package/realm Tag used for new Realms or Packages. label Oct 4, 2024
@ilgooz ilgooz changed the title wip(boardsv2): add boardsv2 feat(boardsv2): add boardsv2 - WIP Oct 4, 2024
Copy link

codecov bot commented Oct 4, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

📢 Thoughts on this report? Let us know!

@ilgooz ilgooz force-pushed the devx/feature/boardsv2 branch from be049e7 to baf9821 Compare October 4, 2024 13:04
Boards v2 package and realm API experimentation

<details><summary>Contributors' checklist...</summary>

- [ ] Added new tests, or not needed, or not feasible
- [ ] Provided an example (e.g. screenshot) to aid review or the PR is
self-explanatory
- [ ] Updated the official documentation or not needed
- [ ] No breaking changes were made, or a `BREAKING CHANGE: xxx` message
was included in the description
- [ ] Added references to related issues and PRs
- [ ] Provided any useful hints for running manual tests
- [ ] Added new benchmarks to [generated
graphs](https://gnoland.github.io/benchmarks), if any. More info
[here](https://github.com/gnolang/gno/blob/master/.benchmarks/README.md).
</details>

---------

Co-authored-by: İlker G. Öztürk <ilker@ilgooz.com>
Co-authored-by: Denys Sedchenko <denis0051@gmail.com>
@jeronimoalbi jeronimoalbi changed the title feat(boardsv2): add boardsv2 - WIP feat(boards2): implement next boards version - WIP Nov 11, 2024
@jeronimoalbi jeronimoalbi self-assigned this Nov 11, 2024
jeronimoalbi and others added 11 commits November 11, 2024 15:12
We won't continue in that direction right now, the current objective is
to finish new features for `boards` which will become `boards2`.
Co-authored-by: Manfred Touron <94029+moul@users.noreply.github.com>
Co-authored-by: Jae Kwon <53785+jaekwon@users.noreply.github.com>
Co-authored-by: Jeff Thompson <jeff@thefirst.org>
Co-authored-by: Hariom Verma <hariom.verma@tendermint.com>
Co-authored-by: Morgan <morgan@morganbaz.com>
Co-authored-by: Albert Le Batteux <contact@albttx.tech>
Co-authored-by: Guilhem Fanton <8671905+gfanton@users.noreply.github.com>
Co-authored-by: Blake <104744707+r3v4s@users.noreply.github.com>
Co-authored-by: Jeff Thompson <jeff@berty.tech>
Co-authored-by: Leon Hudak <33522493+leohhhn@users.noreply.github.com>
Co-authored-by: Poroburu <poroburu@gmail.com>
Co-authored-by: deelawn <dboltz03@gmail.com>
Co-authored-by: grepsuzette <350354+grepsuzette@users.noreply.github.com>
Co-authored-by: jon roethke <waymobetta@users.noreply.github.com>
Refactors the code copied from `gno.land/r/demo/boards` to simplify it
and to have it ready before introducing the new features.
Co-authored-by: x1unix <denis0051@gmail.com>
Use correct package name for boards2 realm.
Related to #3139

Permissioner interface is defined based on Jae's idea to handle permissioned tasks.
---------

Co-authored-by: Jae Kwon <53785+jaekwon@users.noreply.github.com>
@Gno2D2
Copy link
Collaborator

Gno2D2 commented Nov 29, 2024

🛠 PR Checks Summary

All Automated Checks passed. ✅

Manual Checks (for Reviewers):
  • IGNORE the bot requirements for this PR (force green CI check) (checked by @jeronimoalbi)
Read More

🤖 This bot helps streamline PR reviews by verifying automated checks and providing guidance for contributors and reviewers.

✅ Automated Checks (for Contributors):

No automated checks match this pull request.

☑️ Contributor Actions:
  1. Fix any issues flagged by automated checks.
  2. Follow the Contributor Checklist to ensure your PR is ready for review.
    • Add new tests, or document why they are unnecessary.
    • Provide clear examples/screenshots, if necessary.
    • Update documentation, if required.
    • Ensure no breaking changes, or include BREAKING CHANGE notes.
    • Link related issues/PRs, where applicable.
☑️ Reviewer Actions:
  1. Complete manual checks for the PR, including the guidelines and additional checks if applicable.
📚 Resources:
Debug
Manual Checks
**IGNORE** the bot requirements for this PR (force green CI check)

If

🟢 Condition met
└── 🟢 On every pull request

Can be checked by

  • Any user with comment edit permission

jeronimoalbi and others added 30 commits January 31, 2025 09:16
Add missing filetests for `FlagThread()` function.

Related to #3623

This covers all tests for the function:
- Successfully flag a thread
- Fail because board is not found
- Fail because user has no permission to flag a thread
- Fail because thread is not found
- Fail because default flag threshold of 1 is exceeded
- Successfully flag a thread using a user with permission to flag
Add missing filetests for `DeleteThread()` function.

Related to #3623

This covers all tests for the function:
- Successfully delete a thread
- Fail because board is not found
- Fail because thread is not found
- Fail because user has no permission to delete a thread
- Successfully delete a thread using a user with permission to delete
Add missing filetests for `GetBoardIDFromName()` function.

Related to #3623

This covers all tests for the function:
- Successfully get ID by name
- Fail because name is not found
Add missing filetests for `CreateReply()` function.

Related to #3623

This covers all tests for the function:
- Successfully create a reply
- Fail because board is not found
- Fail because thread is not found
- Fail because parent reply is not found
- Fail because thread is hidden
- Fail creating sub-reply because thread is hidden
- Fail creating sub-reply because parent reply is hidden
- Fail because user has no permission to create a reply
- Fail w/ empty body
- Successfully create a sub-reply
Add missing filetests for `EditReply()` function.

Related to #3623

This covers all tests for the function:
- Successfully edit of a reply
- Successfully edit of a sub-reply
- Fail because board is not found
- Fail because thread is not found
- Fail because parent reply is not found
- Fail when edited by a user that is not the creator of the reply
- Fail when reply is hidden because is flagged
- Fail w/ empty body
Add missing filetests for `FlagReply()` function.

Related to #3623

This covers all tests for the function:
- Successfully flag a reply
- Fail because board is not found
- Fail because thread is not found
- Fail because reply is not found
- Fail because default flag threshold of 1 is exceeded
- Fail because user has no permission to flag a reply
- Successfully flag a thread using a user with permission to flag
Add missing filetests for `DeleteReply()` function.

Related to #3623

This covers all tests for the function:
- Successfully delete a reply
- Fail because board is not found
- Fail because thread is not found
- Fail because reply is not found
- Successfully delete a sub-reply
- Fail because user has no permission to delete a reply
- Successfully delete a reply using a user with permission to delete
* Add `CreateRepost` tests:
  * sequential repost
  * repost flagged



Related to: #3623

CC @salmad3 @jeronimoalbi
…#3724)

This enables each board to use a flagging threshold different than the
default of 1.

Threshold specifies how many flags are required for a thread or comment
to be hidden.
Removing these asserts allows realms to interact with the boards which
is convenient when implementing custom permissions/DAO to support custom
features.

An example case could be a realm that publishes tutorials which could
implement the permissions and have a feature where after a tutorial is
published would create a thread within a tutorials board to deal with
discussions or questions related to it.
…3754)

PR also adds a couple of other small cleanup changes:
- Use `boardID` instead of `bid` in public realm functions
- Remove private boards legacy code
- Simplify flag instantiation
Realm permissions should have minimal permissions. Boards should be
treated as independent communities.

At this point it makes sense to only have two roles for the boards realm
permissions, owners and admins, where admins can only create boards.
Owners are the ones that can manage members in addition to be able to
create new boards.

Realm permissions could have more roles and permissions in the future
when new features are introduced.
The default permissions implementation is an implementation of the
`Permissions` interfaces that is used by default when creating new
boards and also used as the default realm permissions.

The original idea is to be able to switch the implementation for a
custom one allowing boards to customize the board interaction rules, or
to be able to switch the realm implementation for a different one that
uses another DAO with different board creation rules for example. This
is an idea that still requires further discussions and refinement.

This PR removes the default permission creation options which at this
point makes no sense given that we don't have a boards2 package and
default permissions are only used within the realm.
THis was discussed at some point but it turns out is not going to be
used by Boards2.
PR add missing options that link to Gnoweb help forms to allow easy
generation of `gnokey` commands.

It also introduces new menus using a simplistic Markdown to simulate
sub-menus to avoid extensive menu entries that require specific
permissions to execute.

Board List Menu:
<img width="429" alt="Screenshot 2025-02-23 at 18 40 44"
src="https://github.com/user-attachments/assets/2118572f-254b-4cf9-95de-a3453df70eb8"
/>

Board Menu:
<img width="413" alt="Screenshot 2025-02-23 at 18 40 57"
src="https://github.com/user-attachments/assets/2c3bcd08-4bfa-4292-8329-588596ec3c91"
/>

<img width="443" alt="Screenshot 2025-02-23 at 18 41 05"
src="https://github.com/user-attachments/assets/9b5e4990-4fa7-4d65-a98b-082b7295c7fd"
/>
Permissions interface allows assigning different permissions
implementation to the boards2 realms and to individual boards.

This interface may use a DAO to deal with members and governance.

It would be convenient to be able to switch the permissions interface to
allow each board to have a custom implementation that enforces custom
rules.

Apart from individual boards it's also convenient to be able to assign a
custom implementation for boards realm permissions which for example
might want to use a different DAO.
PR adds two new views to list realm or board members:
- `/r/nt/boards2/v1:members`
- `/r/nt/boards2/v1:BOARD_NAME/members`

Views list the member address and assigned role.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🧾 package/realm Tag used for new Realms or Packages.
Projects
Status: No status
Development

Successfully merging this pull request may close these issues.

4 participants