Skip to content

NRT Migration Phase 2 #324

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

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

NRT Migration Phase 2 #324

wants to merge 4 commits into from

Conversation

josephmyers
Copy link
Collaborator

@josephmyers josephmyers commented Apr 17, 2025

This change is Reviewable

Copy link

github-actions bot commented Apr 17, 2025

LCM Tests

    16 files  ±0      16 suites  ±0   3m 22s ⏱️ +27s
 2 830 tests ±0   2 810 ✅ ±0   20 💤 ±0  0 ❌ ±0 
11 268 runs  ±0  11 100 ✅ ±0  168 💤 ±0  0 ❌ ±0 

Results for commit a45a53c. ± Comparison against base commit 27a891c.

♻️ This comment has been updated with latest results.

This was likely recommended by AI, but it breaks a number of tests.
@@ -1316,9 +1313,9 @@ private void AddToHomographDict(ILexEntry entry)
{
string key = entry.HomographFormKey;
object oldVal;
if (m_homographInfo.TryGetValue(key, out oldVal))
if (m_homographInfo!.TryGetValue(key, out oldVal))
Copy link
Contributor

Choose a reason for hiding this comment

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

what if we just create a new dictionary here if it's null? I know it's not called today when it's not null, but if it was in the future then it should probably just be created

@@ -103,7 +105,7 @@ public IAnalysis GetObject(int hvo)
return (IAnalysis)m_everythingRepos.GetObject(hvo);
}

public bool TryGetObject(int hvo, out IAnalysis obj)
public bool TryGetObject(int hvo, out IAnalysis? obj)
Copy link
Contributor

Choose a reason for hiding this comment

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

I suggest for these TryGet methods we put [MaybeNullWhen(false)] on the out variable, then we can remove the ?, that says when false is returned obj can be null.

@@ -2,6 +2,8 @@
// This software is licensed under the LGPL, version 2.1 or later
// (http://www.gnu.org/licenses/lgpl-2.1.html)

#nullable enable
Copy link
Contributor

Choose a reason for hiding this comment

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

yeah maybe let's not enable it here since we just had to put ! all over the place, I'm not sure it's adding anything

private string[] m_saSegments;
private bool m_fSuccess = false;
private string m_sErrorMessage = "";
private PhonEnvParser? m_parser;
Copy link
Contributor

Choose a reason for hiding this comment

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

I say we just new up the parser here. It seems like it will be created when it's needed, but there's no arguments required so we should just make it here so it's never null.

@josephmyers
Copy link
Collaborator Author

@hahn-kev, I know it's been a while since we last worked on this. The last thing we discussed was wanting to push this WIP so that you/we could determine how we want to proceed. This work is really all over the place, because I was trying to get various AI's to do what I wanted, finding minimal success with any. I may give this more effort today.

I remember two major directions we were considering, though there are surely more:

  • Enabling nullable for only the classes directly relevant to you and your team's needs
  • Enabling nullable by project, starting with the "least dependent"

I don't think fixing everything at once, which is where this PR currently is, is proving to be the most practical.

@josephmyers
Copy link
Collaborator Author

I spent some time working with an updated version of Copilot today, feeding it some highly explicit instructions and focusing its scope. I was able to reach something pretty acceptable with the Build.Tasks project. I'm going to continue to apply this procedure to other projects, as long as it continues to work well

@josephmyers
Copy link
Collaborator Author

So, at this point, we have a couple viable options:

  • Keep everything relevant to you and your team, as well as the changes in Build.Tasks and Utils, undoing everything else
  • Press on with the remaining projects (after I've finished my work for LexBox)

@josephmyers
Copy link
Collaborator Author

@hahn-kev is this guy dead in the water? Last I checked, we needed something different than just a regular code review here. More of a discussion as to how we want to press forward. It may be easiest, given my current availability, to try to identify the portions of this that are acceptable and undo the rest.

@hahn-kev
Copy link
Contributor

hahn-kev commented Jun 4, 2025

Yeah I think you're right. I think the changes made to public interfaces are where the real benefit is going to be found. Everything else will benefit internal LCM work, but will take to much time to be worth it for the time being.

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.

2 participants