+
Skip to content

Conversation

PDeanCalnex
Copy link
Contributor

Summary

In our upcoming firmware release we have had to change how our settings files are applied and ignore any settings that are for channels that are not installed

This results in the GO tool constantly seeing some settings that it thinks are wrong for channels that are not installed so constantly stopping a measurement and applying a new settings file where some of the settings are being ignored.

These changes check for the installed setting for each channel being 1 before allowing changes to the expected settings for comparison before upload

There is a simpler way to mitigate this which is to remove the references to channels A and B so those channels are never set as they are the main culprits, but it is less robust, and would be less useful for anyone else using the applicaiton.

Test Plan

I have added to the unit tests. I can do some more testing if you are happy with this as the solution and not just removing channel A/B references.

@meta-cla meta-cla bot added the CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed. label Oct 15, 2025
c.set(target, s, fmt.Sprintf("%s\\freq", ch.CalnexAPI()), "1 Hz")
c.set(target, s, fmt.Sprintf("%s\\suppress_steps", ch.CalnexAPI()), api.YES)
}
// log.Debugf("%s: look at changing channel %s", target,ch)
Copy link
Contributor

Choose a reason for hiding this comment

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

Could you please remove all commented out lines - it makes it harder to review

c.set(target, s, fmt.Sprintf("%s\\suppress_steps", ch.CalnexAPI()), api.YES)
}
// Check that physical channel (not virtual) is installed before trying to change any settings
if c.chGet(s, ch, "installed") == "1" {
Copy link
Contributor

@leoleovich leoleovich Oct 15, 2025

Choose a reason for hiding this comment

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

Just a suggestion to make this changeset a lot smaller, how about

if c.chGet(s, ch, "installed") == "0" {
    log.Debugf("%s: no change to channel %s it is not installed", target, ch)
    continue
}

// <code as before>

Would this work?

Copy link
Contributor

@leoleovich leoleovich Oct 15, 2025

Choose a reason for hiding this comment

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

Well it could be != "1" as well

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yes that helps with the changes being clearer. VS code hides some of the changes So looked more reasonable at my end

I have been able to remove some logic further down as well as it shouldn't get there as well when disabling unused channels the installed check is not needed.

Comment on lines 247 to 258
// set the modified config

Copy link
Contributor

Choose a reason for hiding this comment

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

Was this an incorrect statement?

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 think I just caught an extra line removing some of my commented out debug code

@leoleovich
Copy link
Contributor

@PDeanCalnex looks much better, but I think a bunch of tests now broken. For example:

github.com/facebook/time/calnex/config
--- FAIL: TestMeasureConfig2 (0.00s)
    config_test.go:810: 
        	Error Trace:	/builddir/build/BUILD/golang-github-facebook-time-0-build/time-0/_build/src/github.com/facebook/time/calnex/config/config_test.go:810
        	Error:      	Should be false
        	Test:       	TestMeasureConfig2
time="2025-10-15T16:05:26Z" level=info msg="127.0.0.1:34171: pushing the config"
--- FAIL: TestSaveConfig (0.00s)
    config_test.go:1642: 
        	Error Trace:	/builddir/build/BUILD/golang-github-facebook-time-0-build/time-0/_build/src/github.com/facebook/time/calnex/config/config_test.go:1642
        	Error:      	elements differ

Copy link

meta-codesync bot commented Oct 17, 2025

@leoleovich has imported this pull request. If you are a Meta employee, you can view this in D84908650.

@leoleovich
Copy link
Contributor

Looks good overall, will wait for tests to complete and merge. Ok with you @PDeanCalnex?

Copy link

meta-codesync bot commented Oct 17, 2025

@leoleovich merged this pull request in 54b50e6.

@PDeanCalnex
Copy link
Contributor Author

I'm doing a final check against a couple of units. Works fine against our latest code. A unit is just downgrading to R22.0.1 so I can do a final sanity check against that.

@leoleovich
Copy link
Contributor

I ran it against a random device on the fleet and it showed no changes, so should be good

@PDeanCalnex
Copy link
Contributor Author

Then all good by me I think

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed. Merged

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants

点击 这是indexloc提供的php浏览器服务,不要输入任何密码和下载