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

chore: refactor relative path to better absolute #2861

Merged
merged 13 commits into from
Jul 5, 2024
Merged

Conversation

darshankabariya
Copy link
Contributor

closes #2845

Copy link

github-actions bot commented Jul 1, 2024

You can find the image built from this PR at

quay.io/wakuorg/nwaku-pr:2861

Built from 6332392

Copy link

github-actions bot commented Jul 1, 2024

This PR may contain changes to configuration options of one of the apps.

If you are introducing a breaking change (i.e. the set of options in latest release would no longer be applicable) make sure the original option is preserved with a deprecation note for 2 following releases before it is actually removed.

Please also make sure the label release-notes is added to make sure any changes to the user interface are properly announced in changelog and release notes.

Copy link
Contributor

@gabrielmer gabrielmer left a comment

Choose a reason for hiding this comment

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

LGTM, thanks so much!

Copy link
Contributor

@NagyZoltanPeter NagyZoltanPeter left a comment

Choose a reason for hiding this comment

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

In general I like the approach, but I would better leave the reference to the waku/ directory and just eliminate the ../.. like stuff.
I think the would help reading the imports. Similarly we have chronos/... nim-eth/, etc references in imports.
So treat waku as a lib for tests and apps. WDYT?

@@ -1,3 +1,4 @@
-d:chronicles_line_numbers
-d:chronicles_runtime_filtering:on
-d:discv5_protocol_id:d5waku
path = "../../waku"
Copy link
Contributor

Choose a reason for hiding this comment

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

Me, personally would prefer better to always use the waku/ prefix all the time we refer the library from an app.
For me it is harder to read from where are those imports coming.
WDYT?

@NagyZoltanPeter
Copy link
Contributor

@darshankabariya: Please consider to wait with merging it with in sync with next release, maybe just before cut off and release-notes. That will help other's branch rebasing before merge, otherwise there can be many conflicts for some branches.
cc: WDYT @gabrielmer, @Ivansete-status

@darshankabariya
Copy link
Contributor Author

In general I like the approach, but I would better leave the reference to the waku/ directory and just eliminate the ../.. like stuff. I think the would help reading the imports. Similarly we have chronos/... nim-eth/, etc references in imports. So treat waku as a lib for tests and apps. WDYT?

Got it ! it's better clarity then this.

@darshankabariya
Copy link
Contributor Author

darshankabariya commented Jul 1, 2024

@darshankabariya: Please consider to wait with merging it with in sync with next release, maybe just before cut off and release-notes. That will help other's branch rebasing before merge, otherwise there can be many conflicts for some branches. cc: WDYT @gabrielmer, @Ivansete-status

Thank you for the suggestion. I understand the concern regarding potential conflicts. All the changes are in the tests and apps directories, tests directory shouldn't cause i guess. However, I agree that waiting a little bit before merging could be beneficial.

Copy link
Collaborator

@Ivansete-status Ivansete-status left a comment

Choose a reason for hiding this comment

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

It is looking beautiful, thanks so much for it! 🙌

Notice that we need to perform some minor adjustments to the tests so that the Ubuntu tests pass as well :P

I agree with you @NagyZoltanPeter that we need to wait until the v0.30.0 is released. @darshankabariya , you will need to rebase from master after the v0.30.0 is released.

On the other hand, we still need to push it a bit further as there are some pending files to be reviewed.

We need the following commands to return 0 (maybe we can add them as a "lint" check on every PR:)

find nwaku/ -mindepth 2 -maxdepth 2 -type f -name '*.nim' -print0 | xargs -0 grep -Fn ../.. | wc -l
find nwaku/ -mindepth 3 -maxdepth 3 -type f -name '*.nim' -print0 | xargs -0 grep -Fn ../../.. | wc -l
find nwaku/ -mindepth 4 -maxdepth 4 -type f -name '*.nim' -print0 | xargs -0 grep -Fn ../../../.. | wc -l

Comment on lines -94 to -99
let
msgOverLimit = fakeWakuMessage(
contentTopic = contentTopic,
payload = getByteSequence(DefaultMaxWakuMessageSize + 64 * 1024),
)

Copy link
Collaborator

Choose a reason for hiding this comment

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

That change sounds as use of different nph version. Maybe is sth we already had. Make sure you applied nph 0.5.1 to that file :)

Copy link
Contributor Author

Choose a reason for hiding this comment

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

i am using that version only. If you want the original state, I will disable it for a while to revert to the previous state.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

image

@@ -12,8 +12,7 @@ import
from std/times import epochTime

import
../../../waku/
[node/waku_node, node/peer_manager, waku_core, waku_node, waku_rln_relay],
waku/node/waku_node, waku/node/peer_manager, waku/waku_core, waku/aku_node, waku/waku_rln_relay
Copy link
Collaborator

Choose a reason for hiding this comment

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

Tiny typo:

Suggested change
waku/node/waku_node, waku/node/peer_manager, waku/waku_core, waku/aku_node, waku/waku_rln_relay
waku/node/waku_node, waku/node/peer_manager, waku/waku_core, waku/waku_node, waku/waku_rln_relay

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Actually, I used a script for these refactor changes. It's open bracket, but I will bundle everything together where necessary and complete the remaining refactoring as well. Thanks for review.

Copy link
Contributor Author

@darshankabariya darshankabariya Jul 4, 2024

Choose a reason for hiding this comment

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

Hi @Ivansete-status,
Please review the PR one more time. There have been many changes after your approval, it’s taking a bit longer than expected because due to bulk changes trouble with build. Besides the command mentioned in the issue, I also attempted to refactor the extra relative paths in the project which missed by those commands. Just reply this comment so get notified for merge.

@Ivansete-status Ivansete-status merged commit 8bfad3a into master Jul 5, 2024
8 of 10 checks passed
@Ivansete-status Ivansete-status deleted the bug_2845 branch July 5, 2024 22:03
@Ivansete-status
Copy link
Collaborator

Thanks so much for that @darshankabariya ! ❤️
I just merged it because I needed it in those changes for "bump dependencies", where we will start using Nim 2.0.8 ( if everything goes well of course ;P )

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.

bug: incorrect import paths pointing outside the repository
4 participants