Skip to content

Conversation

@heliocodacy
Copy link
Contributor

No description provided.

Copilot AI review requested due to automatic review settings January 14, 2026 14:16
@codacy-production
Copy link

codacy-production bot commented Jan 14, 2026

Codacy's Analysis Summary

3 new issues (≤ 1 medium issue)
0 new security issue (≤ 0 issue)
21 complexity
0 duplications

Review Pull Request in Codacy →

AI Reviewer available: add the codacy-review label to get contextual insights without leaving GitHub.

Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR adds support for extracting tar.xz archives and fixes the Flutter plugin configuration to use the correct download URL and file format for Linux systems.

Changes:

  • Added ExtractTarXz function and refactored tar extraction to support both gzip and xz compression
  • Added Linux-specific extension configuration support in ExtensionConfig
  • Updated Flutter plugin to use tar.xz for Linux and corrected the download URL template to exclude architecture

Reviewed changes

Copilot reviewed 4 out of 4 changed files in this pull request and generated 2 comments.

File Description
utils/extract.go Added ExtractTarXz function and refactored ExtractTar to accept compression type as a parameter
plugins/shared.go Added Linux field to ExtensionConfig struct and updated GetExtension function to handle Linux-specific extensions
plugins/runtimes/flutter/plugin.yaml Updated URL template to remove architecture placeholder, changed Linux extension to tar.xz, and updated arch mappings
config/runtimes-installer.go Added tar.xz file detection and extraction logic in the download and extract workflow

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment on lines 84 to 86
if goos == "linux" {
return extension.Linux
}
Copy link

Copilot AI Jan 14, 2026

Choose a reason for hiding this comment

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

The GetExtension function should check if extension.Linux is non-empty before returning it. Currently, if a plugin.yaml has 'linux: ""' specified, it will return an empty string instead of falling back to the Default value. Consider adding a check: if goos == "linux" && extension.Linux != "" { return extension.Linux }.

Copilot uses AI. Check for mistakes.
@@ -1,15 +1,15 @@
name: flutter
description: Dart Flutterruntime
Copy link

Copilot AI Jan 14, 2026

Choose a reason for hiding this comment

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

There is a spelling error in the description. 'Flutterruntime' should be 'Flutter runtime' (with a space).

Copilot uses AI. Check for mistakes.
@codacy-production
Copy link

codacy-production bot commented Jan 14, 2026

Coverage summary from Codacy

See diff coverage on Codacy

Coverage variation Diff coverage
+0.27% (target: -0.50%) 48.65% (target: 50.00%)
Coverage variation details
Coverable lines Covered lines Coverage
Common ancestor commit (a712ffa) 5765 1157 20.07%
Head commit (95e200a) 5798 (+33) 1179 (+22) 20.33% (+0.27%)

Coverage variation is the difference between the coverage for the head and common ancestor commits of the pull request branch: <coverage of head commit> - <coverage of common ancestor commit>

Diff coverage details
Coverable lines Covered lines Diff coverage
Pull request (#190) 37 18 48.65%

Diff coverage is the percentage of lines that are covered by tests out of the coverable lines that the pull request added or modified: <covered lines added or modified>/<coverable lines added or modified> * 100%

See your quality gate settings    Change summary preferences

Copilot AI review requested due to automatic review settings January 14, 2026 14:36
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 5 out of 5 changed files in this pull request and generated 1 comment.


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment on lines +40 to +42
// Basic assertions for flutter
assert.Equal(t, "flutter", flutterInfo.Name)
assert.Equal(t, "3.35.7", flutterInfo.Version)
Copy link

Copilot AI Jan 14, 2026

Choose a reason for hiding this comment

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

The test coverage for Flutter is minimal compared to the Node test. Consider adding assertions to verify the download URL is correctly formatted, the extension is properly set based on the OS (tar.xz for Linux, zip for others), and the install directory is correct. This would help ensure the Flutter-specific configuration changes (linux extension support and removed architecture from URL) work as expected.

Copilot uses AI. Check for mistakes.
Copilot AI review requested due to automatic review settings January 14, 2026 15:43
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 6 out of 6 changed files in this pull request and generated 2 comments.


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

download:
url_template: "https://storage.googleapis.com/flutter_infra_release/releases/stable/{{.OS}}/flutter_{{.OS}}_{{.Arch}}_{{.Version}}-stable.{{.Extension}}"
custom_url_config:
linux: "https://storage.googleapis.com/flutter_infra_release/releases/stable/linux/flutter_{{.OS}}_{{.Version}}-stable.{{.Extension}}"
Copy link

Copilot AI Jan 14, 2026

Choose a reason for hiding this comment

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

The custom URL template for Linux still contains {{.OS}} placeholder which will be substituted with 'linux', resulting in 'flutter_linux_' in the URL. Based on the URL structure and the fact that tar.xz files don't include architecture, this should likely be just flutter_{{.Version}}-stable.{{.Extension}} without the OS placeholder.

Copilot uses AI. Check for mistakes.
url_template: "https://storage.googleapis.com/flutter_infra_release/releases/stable/{{.OS}}/flutter_{{.OS}}_{{.Arch}}_{{.Version}}-stable.{{.Extension}}"
custom_url_config:
linux: "https://storage.googleapis.com/flutter_infra_release/releases/stable/linux/flutter_{{.OS}}_{{.Version}}-stable.{{.Extension}}"
windows: "https://storage.googleapis.com/flutter_infra_release/releases/stable/windows/flutter_{{.OS}}_{{.Version}}-stable.{{.Extension}}"
Copy link

Copilot AI Jan 14, 2026

Choose a reason for hiding this comment

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

The custom URL template for Windows contains {{.OS}} placeholder which will be substituted with 'windows', resulting in 'flutter_windows_' in the URL. This is inconsistent with the original url_template which included architecture ({{.Arch}}). If this custom URL is intended to match the actual Flutter download URLs, verify whether Windows downloads should include the {{.Arch}} placeholder or just the OS.

Copilot uses AI. Check for mistakes.
Copilot AI review requested due to automatic review settings January 14, 2026 15:57
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 7 out of 7 changed files in this pull request and generated no new comments.

Comments suppressed due to low confidence (2)

plugins/runtime-utils.go:66

  • Consider adding Flutter to the special install directory handling. Flutter uses a constant filename 'flutter' (not version-specific), so it should get the same treatment as Python and Go for a cleaner directory structure. This would match the test expectations where installDir = runtimesDir + '/flutter'.
	// For Python, we want to use a simpler directory structure
	var installDir string
	if config.Name == "python" {
		installDir = path.Join(runtimesDir, "python")
	} else if config.Name == "go" {
		installDir = path.Join(runtimesDir, "go")
	} else {
		installDir = path.Join(runtimesDir, fileName)
	}

plugins/runtimes/flutter/plugin.yaml:2

  • Corrected spacing in 'Dart Flutterruntime' to 'Dart Flutter runtime'.
description: Dart Flutterruntime

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Default string `yaml:"default"`
}

type CustomURLConfig struct {

Choose a reason for hiding this comment

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

return ExtractTar(archive, targetDir, archiver.Xz{})
}

func ExtractTar(archive *os.File, targetDir string, compression archiver.Compression) error {

Choose a reason for hiding this comment

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

return ExtractTar(archive, targetDir, archiver.Gz{})
}

func ExtractTarXz(archive *os.File, targetDir string) error {

Choose a reason for hiding this comment

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

@heliocodacy heliocodacy enabled auto-merge (squash) January 14, 2026 16:43
Copy link
Contributor

@machadoit machadoit left a comment

Choose a reason for hiding this comment

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

I think it would be interesting if we revisit this, and stick with only one mechanism for the URL generation. Maybe if/when improvements become a more pressing priority

@heliocodacy heliocodacy merged commit e1bb1bc into main Jan 14, 2026
9 of 10 checks passed
@heliocodacy heliocodacy deleted the add-xz-extraction branch January 14, 2026 16:44
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