-
-
Notifications
You must be signed in to change notification settings - Fork 251
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
Add support for old format for narrow links #1424
Add support for old format for narrow links #1424
Conversation
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.
@mounilKshah Thanks for taking this up 👍
This seems to work just fine, and the tests back this up.
I was going to comment that the test cases you added were a little confusing in places since the message and stream ids are identical, but I note we do that in the other situations too. On that basis, it may be useful to do some cleanup on this test, perhaps as prep commits if you're comfortable with that, namely refactor commits for:
- inlining ids
- adjusting the expected message id to be different to the stream id
- moving the SERVER_URL to be used in the test body instead?
Re the commit text, note that notes re Fixes and the tests normally go on their own lines. I think ZT or Zulip document the former; the latter is likely assumed by Zulip in general, but can be useful to confirm and distinguish between new behavior coverage, adjustments/refactors, test cases vs tests, etc.
For followup:
- We've discussed in the stream that we could document test styles/guidelines. If you'd like to draw together some elements into a document, that'd be useful to direct users towards. Another approach which I briefly explored was enabling pytest checks in ruff.
- We may be able to either document or also add checks for Fixes and tests lines to the gitlint rules we use somehow, which would lower the need to give feedback on this as frequently.
6065476
to
cdbd2e9
Compare
This commit shifts test IDs for test__parse_narrow_link() to be inline with the test cases, and extracts SERVER_URL into the test function body.
This commit provides support for narrow links in message content containing 'subject' instead of 'topic', which may be present in messages before server version 2.1.0. Test cases added. Fixes zulip#1422.
cdbd2e9
to
9d4e7aa
Compare
Minor change to reduce confusion between values of different ids in test cases and ensure they are kept distinct for testing purposes.
@mounilKshah Thanks for the refactor 👍 Adjusted very slightly and added in a small followup commit for message vs stream id distinction I referred to. |
What does this PR do, and why?
This PR contains commit which extends support to the old format for narrow links
which existed before server version 2.1.0
#zulip-terminal > Support old narrow links format #T1422 #T1424
#api-documentation > Narrow URL formats
External discussion & connections
Support old narrow links format #T1422 #T1424
How did you test this?
Self-review checklist for each commit