-
-
Notifications
You must be signed in to change notification settings - Fork 281
Show detected platform on startup and in About popup #1221
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
Conversation
Hello @plugyawn, it seems like you have referenced #1216 in your pull request description, but you have not referenced them in your commit message description(s). Referencing an issue in a commit message automatically closes the corresponding issue when the commit is merged, which makes the issue tracker easier to manage. Please run An example of a correctly-formatted commit:
To learn how to write a great commit message, please refer to our guide. |
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.
@plugyawn Thanks for adding this, when ready it should be helpful for debugging in future 👍
Generally it may be useful to use something along the lines of Detected Platform
instead of the 'Running' and 'Platform' you currently have, both for consistency, and since this is what ZT determines is the platform - we can't know for sure.
This doesn't currently address the idea of showing extra text if the platform is unsupported, from the original issue; you didn't mention skipping it for now in the PR description, so I assume you missed that.
I think I mentioned this in another PR review, but I'd recommend reading your PRs in GitHub and maybe also something like tig or another local viewer, to ensure that the commit text and contents looks like what you'd expect.
zulipterminal/ui_tools/views.py
Outdated
) | ||
contents = [ | ||
("Application", [("Zulip Terminal", zt_version)]), | ||
("Application", [("Zulip Terminal", zt_version), ("Platform", PLATFORM)]), |
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.
This looks OK, though I had originally envisaged it being in a separate section below the others, rather than in the Application
section.
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.
I assumed the version and the platform would go together? I'll put it in a separate section, that does sound better.
I missed the part about checking if the platform is unsupported, sorry -- I'm adding it right now. |
ccede63
to
16f92fe
Compare
Shows PLATFORM from platform_code.py on the About Pop-Up.
Adds tests for checking what platform is detected.
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.
@plugyawn You didn't mark this for review, but here's some feedback since you mentioned updating it in the stream. Please do toggle the labels if you're seeking review.
if PLATFORM: | ||
print("Detected Platform: " + PLATFORM) | ||
else: | ||
print("Running on undetected platform.") |
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.
Is this intended to be for unsupported platforms, or something else?
Please make sure you're aware what values this can take :)
You're not testing this result, in any case.
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.
Is this intended to be for unsupported platforms, or something else?
Please make sure you're aware what values this can take :)
You're not testing this result, in any case.
I'll look into that; I'm still not exactly sure how to check for unsupported platforms, though.
"Application", | ||
[ | ||
("Zulip Terminal", zt_version), | ||
("Platform detected", PLATFORM if PLATFORM else "Invalid platform"), |
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.
This condition shouldn't arise - again, check the values of PLATFORM.
captured = capsys.readouterr() | ||
lines = captured.out.strip().split("\n") | ||
expected_lines = [ | ||
f"Detected Platform: {PLATFORM}", |
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.
Is there a reason you used different code here?
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.
None, I'll change it to the same code as the others.
|
||
lines = captured.out.strip().split("\n") | ||
expected_lines = [ | ||
"Detected Platform: " + PLATFORM, |
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.
Note that this will be the platform that the tests are running on. We may want to mock this instead to ensure we get some known output (and avoid the running vs testing confusion for readers).
It's good to keep tests in the same commit as the code that changes, as it's a unit of change, so here combined with one of the other commits.
We may want a specific test to handle how this output should vary on different platforms, including unsupported.
Heads up @plugyawn, we just merged some commits that conflict with the changes you made in this pull request! You can review this repository's recent commits to see where the conflicts occur. Please rebase your feature branch against the |
What does this PR do?
Shows the detected platform on startup and in the About pop-up.
Tries to fix #1216.
Tested?
Commit flow
Notes & Questions
Interactions
Visual changes

