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

2024.3 Final master to beta merge #16776

Merged
merged 16 commits into from
Jul 1, 2024
Merged

2024.3 Final master to beta merge #16776

merged 16 commits into from
Jul 1, 2024

Conversation

seanbudd
Copy link
Member

@seanbudd seanbudd commented Jul 1, 2024

Final merge for 2024.3 release, using commit ba04b511ecc9321b180eed3ee50f3c807d6518e1 from master.
Changes intended for 2024.3 must now set base/target to the beta branch

*Merge not squash

Summary by CodeRabbit

  • New Features

    • Enabled ruff linter tool for improved code quality checks.
    • Added configurations for integrating the ruff-pre-commit tool.
  • Bug Fixes

    • Corrected a typo in the issue template configuration.
  • Documentation

    • Reformatted CONTRIBUTING.md and CODE_OF_CONDUCT.md for better clarity and readability.
  • Chores

    • Updated .gitattributes for better file normalization and diffing.
    • Added appveyor-tools/ to .gitignore.
  • Refactor

    • Improved the decryptFilesForSigning.ps1 script by removing unnecessary certificate decryption steps.
    • Enhanced setSconsArgs.ps1 to include apiSigningToken for better feature signing.
  • Style

    • Reformatted multiple files for consistent indentation and spacing without altering functionality.

jcsteh and others added 16 commits June 26, 2024 16:58
Fixes #16722.

Summary of the issue:
When a client disconnects from a Remote Desktop session without exiting NVDA on the server, WASAPI can throw ERROR_TOO_MANY_FILES, which is not a WASAPI error code and thus not expected by the C++ code. E_NOTFOUND is also possible, probably thrown by IMMDeviceEnumerator::GetDefaultAudioEndpoint. WasapiWavePlayer.feed raises an exception, which breaks the oneCore driver because it isn't expecting exceptions. Speech is broken henceforth.

Description of user facing changes
Speech is no longer silent after disconnecting from and reconnecting to a Remote Desktop session.

Description of development approach
I changed WasapiWavePlayer.feed to log exceptions and return without raising them.

I could have tweaked the C++ code to handle ERROR_TOO_MANY_FILES and E_NOTFOUND as well as the codes it already handles (AUDCLNT_E_DEVICE_INVALIDATED and AUDCLNT_E_NOT_INITIALIZED). However, I figured it was best to make this code more resilient in general by catching exceptions, especially given that WinmmWavePlayer.feed also catches exceptions.
sslpoint.com/new-private-key-storage-requirement-for-standard-code-signing-certificates
New requirements for Authenticode signing certificates which require a hardware token

Description of user facing changes
None - only developers (see below)
Description of development approach
SCons build pipeline modified to use SignPath's code signing pipeline
…longer necessary. (#16746)

Reverts #10707.

Summary of the issue:
Firefox moved most iframes into different processes (AKA out-of-process iframes or project "Fission") in 2020. This necessitated some changes to NVDA because with Firefox's older multi-process architecture, objects in one process were unaware of objects in another. However, with the new "Cache the World" architecture released in Firefox 113 (just over a year ago in May 2023), this special handling is no longer necessary, since all objects are served from the parent process and the parent process is aware of all of them.

While removing this code likely doesn't have any discernible user benefit, I think it's worthwhile to remove unnecessary complexity.

There is no supported version of Firefox (even ESR) which depends on this code.

Description of user facing changes
None. There might be a slight performance benefit, but I doubt this is perceivable.

Description of development approach
Reverted #10707, adjusting for non-substantive changes that were made since #10707 was merged (code style, moved constants, etc.).

Note that this moves back to using accChild instead of getNVDAObjectFromEvent. At the time, there didn't appear to be a performance benefit to using accChild and using getNVDAObjectFromEvent made it easier to implement #10707. However, I have since then discovered (through Firefox profiling) that at least in-process, AccessibleObjectFromWindow can be rather slow relative to direct COM calls. This probably isn't noticeable for NVDA's use case, especially given that we're doing this across processes, but any performance boost is probably worthwhile here.

I didn't add a change log entry because there is no user visible change here
… at the end of a line. (#16745)

Fixes #3156. Strictly speaking, that issue covers other problems as well, but this addresses the issue for which it was originally opened. Other issues should be (re)opened for any remaining problems.

Summary of the issue:
When editing text, there is an insertion point at the end of a line. This is where you are positioned when you press the end key. Firefox also allows you to reach this position with the left/right arrow keys. When text wraps across multiple lines, lines other than the last have this insertion point, but it does not have its own IAccessible2 offset, since it doesn't actually exist in the text. Instead, the caret offset reported is the same offset as the start of the next line.

This is problematic for NVDA because when the user is at this position, NVDA reports the character at the start of the next line. Worse, it reports the next word and line instead of the current word and line.

Description of user facing changes
In Mozilla Firefox, NVDA now correctly reports the current character, word and line when the cursor is at the insertion point at the end of a line.

Description of development approach
IAccessible2 provides IA2_TEXT_OFFSET_CARET to deal with this. While somewhat awkward, the idea is that you pass this special offset to IAccessibleText functions so that they know you care about the caret and can handle it specially if the caret is at the end of line insertion point. For example, asking for the character at the caret might report (3, 3, None), where 3 is the caret offset. In contrast, if the caret was at the start of the next line, it might report (3, 4, 'c'). Similarly, asking for the line at the caret when at the end of the line might report (0, 3, 'ab ') instead of (3, 6, 'cd ') at the start of the next.

Unfortunately, making NVDA use IA2_TEXT_OFFSET_CARET when fetching units is tricky. IA2TextTextInfo would need to keep track of the fact that it was constructed for the caret and pass IA2_TEXT_OFFSET_CARET if so. But this means that when the caret moves, the TextInfo moves too, which breaks detaching the review cursor from the caret, etc.

Instead, a flag _isEndOfLineInsertionPoint has been added to MozillaCompoundTextInfo. This is set by querying the character at IA2_TEXT_OFFSET_CARET when constructing with POSITION_CARET. This allows us to implement special behaviour when this is True: we expand to no character, we expand to the current word/line instead of the next word/line, etc. If the TextInfo is copied, this flag is copied too. If the TextInfo is mutated in any way, the flag is set to False. This allows us to represent this position (even across copies) without being attached to the current position of the caret.

Some of this could theoretically be done in IA2TextTextInfo, but that would have meant plumbing (and coupling) this special casing through both classes. I'm not aware of any other implementation which supports IA2_TEXT_OFFSET_CARET that doesn't use MozillaCompoundTextInfo.

Note that although Chromium supports IA2_TEXT_OFFSET_CARET, it doesn't special case the insertion point at the end of a line. Thus, although this works fine in Chromium, there is no benefit there, though Chromium could choose to implement this to gain that benefit.
Part of #12387

Summary of the issue:
The NVDA code base uses a mix of CRLF and LF style line endings, with the preference being CRLF.
LF style endings have been introduced prior to lint checking, and can causes issues when moving code or making changes.
Many IDEs will normalize the line endings when editing files, causing larger than intended diffs of files with mixed line endings.
Instead, we should normalize all line endings of text files to LF and ensure that all files are committed with LF line endings.

Specific files should be excluded from normalization such as:

files used by translators, as we are uncertain of the side-effects here
binary files
git allows independent configurations between line endings used when a developer checkouts out code locally, and when code is committed to a repository.
IDEs are often better suited for different line endings, with LF line endings becoming more and more standardised.
However, NVDA is Windows based development, where CRLF line ending usage is commonly default or compulsory.
Developers can checkout code locally, using whatever line endings they prefer or their IDE requires, using git config.core autocrlf.

We can configure what line endings we commit to the repository with .gitattributes.
This is set on a repository level.
As what line endings we commit with is agnostic to what is checked out, the decision is based on what works best for the repository.
Unix style line endings usage and support continues to increase on Windows and LF files.
LF tends to be better supported by Unix style developer tools such as git.
LF uses less data than CRLF.
Follow up to #12816
Closes #12387

Must be merge commit

Performed the following:

git add --renormalize .
git commit -m "normalize line endings"
Added the commit to .git-blame-ignore-revs

Testing

Confirmed testing by ensuring the diff is empty

git diff --ignore-cr-at-eol origin/master normalize-all-line-endings
…evious character is a line feed. (#16763)

Fixup of #16745.

Summary of the issue:
In my work on #16745, I neglected to consider an empty line after a line feed. In that case, adjusting for the line end caused NVDA to read from the previous line instead of the empty one.

Description of user facing changes
In Firefox, NVDA no longer speaks the previous line when the caret is on the last line and the last line is empty. However, this does not need a change log entry because this bug never shipped in release.

Description of development approach
Don't set the _isInsertionPointAtEndOfLine flag to True if the previous character is a line feed. This prevents the line end adjustment.

Because this additional check makes the code a little more complex, I refactored this code into a helper method.
Fixes #16735

Summary of the issue:
This adds Turkish grade 2 braille table to NVDA interface.

Description of user facing changes
Users will be able to use the table provided in NVDA

Description of development approach
Modified the brailleTables.py.
Fixes #14817

Summary of the issue:
Our linting system has the following issues:

we are stuck on an old version of flake8, as the flake8tabs module is no longer being updated
we can't perform automatic lint fixes
Ruff is becoming more maintained than flake8
Description of user facing changes
The entire repository is linted with Ruff, rather than diffs
Developers can now automatically fix certain linting issues with runlint.bat
If using pre-commit hooks, linting is automatically applied: pre-commit.com/#usage
CodeRabbit now scans code using our Ruff config
Description of development approach
integrate Ruff, migrate flake8 config
Update AppVeyor scripts to use ruff
add pre commit hook support for ruff
update linting docs
Lint the repository with Ruff

This is a follow up for #16751
Must be merge commit not squash merge

Using #16751, the following commands were applied:

ruff check --fix to apply automatic fixes
ruff check --add-noqa to add no-qa comments to all lint failures, so that issues that can't be automatically fixed don't trigger future failures
@seanbudd seanbudd requested review from a team as code owners July 1, 2024 00:32
@seanbudd seanbudd requested review from Qchristensen and michaelDCurran and removed request for a team July 1, 2024 00:32
Copy link
Contributor

coderabbitai bot commented Jul 1, 2024

Warning

Review failed

The pull request is closed.

Walkthrough

The overall changes aim to improve and standardize coding practices, enhance documentation, and streamline various build and testing scripts. Key tasks include enabling the ruff linter, updating file attributes for normalization purposes, reformatting and updating scripts for clarity, and modifying environment variables. Additionally, several configuration files have been adjusted to enhance readability and maintainability without altering their core functionality.

Changes

File Path(s) Change Summary
.coderabbit.yml Enabled the ruff tool.
.git-blame-ignore-revs Updated documentation links, added instructions for git config, normalized line endings.
.gitattributes Added/updated text attributes for various file types.
.github/CODEOWNERS Comments and whitespace changes without altering ownership configurations.
.github/CONTRIBUTING.md, CODE_OF_CONDUCT.md Rephrased and restructured content for better clarity and readability.
.github/ISSUE_TEMPLATE/config.yml Corrected a typo.
.github/.../revert.md Updated formatting and structure of the template.
.gitignore Added appveyor-tools/ to the ignored patterns.
.pre-commit-config.yaml Introduced configurations for integrating the ruff-pre-commit tool.
.vsconfig Reformatted JSON content, changing indentation.
appveyor.yml Updated environment variables, added new command, adjusted build scripts.
appveyor/mozillaSyms.py Removed import argparse, updated comments.
appveyor/scripts/* Reformatting, adding comments, adjusting variable assignments, and updating error handling/commands across multiple scripts.
appveyor/scripts/tests/*.ps1 Added comments, updated test configurations, streamlined linting process, handled browser start-up and test configuration adjustments.
appx/* Adjusted logic for signExec variable determination, formatting adjustments.
contributors.txt Minor formatting adjustments.
extras/controllerClient/examples/example_c*/*, SpeechPriority.cs Whitespace adjustments, comments repositioning, code formatting, no functional changes.

Sequence Diagram(s)

N/A


Tip

Early access features: enabled

We are currently testing the following features in early access:

  • OpenAI gpt-4o model for code reviews and chat: OpenAI claims that this model is better at understanding and generating code than the previous models. We seek your feedback over the next few weeks before making it generally available.

Note:

  • You can enable or disable early access features from the CodeRabbit UI or by updating the CodeRabbit configuration file.
  • Please join our Discord Community to provide feedback and report issues.

Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media?

Share
Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>.
    • Generate unit testing code for this file.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query. Examples:
    • @coderabbitai generate unit testing code for this file.
    • @coderabbitai modularize this function.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai generate interesting stats about this repository and render them as a table.
    • @coderabbitai show all the console.log statements in this repository.
    • @coderabbitai read src/utils.ts and generate unit testing code.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.
    • @coderabbitai help me debug CodeRabbit configuration file.

Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments.

CodeRabbit Commands (invoked as PR comments)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai full review to do a full review from scratch and review all the files again.
  • @coderabbitai summary to regenerate the summary of the PR.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

Additionally, you can add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.

CodeRabbit Configration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • Please see the configuration documentation for more information.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json

Documentation and Community

  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

@seanbudd seanbudd changed the title WasapiWavePlayer.feed: Log exceptions but don't raise them. (#16738) 2024.3 Final master to beta merge Jul 1, 2024
@seanbudd seanbudd added this to the 2024.3 milestone Jul 1, 2024
@seanbudd seanbudd merged commit 368e68c into beta Jul 1, 2024
1 of 3 checks passed
@seanbudd seanbudd deleted the branchFor2024.3 branch July 1, 2024 00:33
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.

4 participants