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

Install scripts should always fetch and verify checksums. #2824

Merged
merged 2 commits into from
Oct 18, 2023

Conversation

mitchell-as
Copy link
Contributor

@mitchell-as mitchell-as commented Oct 17, 2023

TaskDX-2266 Install.ps1 and install.sh should ALWAYS verify the checksum

@mitchell-as mitchell-as force-pushed the mitchell/dx-2266 branch 2 times, most recently from 9a17939 to 2826ad1 Compare October 17, 2023 18:01
@mitchell-as
Copy link
Contributor Author

Test failures are not due to this PR. They are due to existing, known issues and the usual timeouts.

@mitchell-as mitchell-as requested a review from Naatan October 17, 2023 18:27
@mitchell-as mitchell-as marked this pull request as ready for review October 17, 2023 18:27
# Fetch version info.
try {
$infoJson = ConvertFrom-Json -InputObject (download $jsonURL)
} catch [System.Exception] {
Copy link
Member

Choose a reason for hiding this comment

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

I think we should report what the exception was, otherwise debugging will be painful.

Copy link
Contributor Author

@mitchell-as mitchell-as Oct 17, 2023

Choose a reason for hiding this comment

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

Exceptions are output to stdout, so there's no need for additional work. I tested this and it's pretty clear what the issue is (e.g. network unreachable). Or do you mean reported to us via rollbar or something?

RELURL="$CHANNEL/$VERSIONNOSHA/$OS-amd64/state-$OS-amd64-$VERSION$DOWNLOADEXT"
fi

rm $INSTALLERTMPDIR/info.json
Copy link
Member

Choose a reason for hiding this comment

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

Comment on lines +126 to +127
VERSIONNOSHA="`echo $VERSION | sed 's/-SHA.*$//'`"
JSONURL="$BASE_INFO_URL?channel=$CHANNEL&source=install&platform=$OS&target-version=$VERSIONNOSHA"
Copy link
Member

Choose a reason for hiding this comment

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

This means that we basically ignore the SHA part. I think we should at least verify that the returned info matches the SHA in this scenario.

Comment on lines +130 to +131
$versionNoSHA = $version -replace "-SHA.*", ""
$jsonURL = "$script:BASEINFOURL/?channel=$script:CHANNEL&platform=windows&source=install&target-version=$versionNoSHA"
Copy link
Member

Choose a reason for hiding this comment

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

This means that we basically ignore the SHA part. I think we should at least verify that the returned info matches the SHA in this scenario.

@mitchell-as mitchell-as requested a review from Naatan October 17, 2023 19:25
@mitchell-as mitchell-as reopened this Oct 18, 2023
@mitchell-as mitchell-as merged commit e2d5901 into version/0-42-0-RC1 Oct 18, 2023
10 of 12 checks passed
@mitchell-as mitchell-as deleted the mitchell/dx-2266 branch October 18, 2023 17:52
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