Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions internal/cli/cli.go
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ func NewApp() *cli.App {
&cli.StringFlag{
Name: "runtime",
Aliases: []string{"r"},
Usage: "runtime name (nodejs, python, tomcat, yarn, temurin, vscode, intellij_idea_ultimate, pycharm_professional). If not specified, downloads all enabled runtimes from config",
Usage: "runtime name (nodejs, python, tomcat, yarn, temurin, vscode, intellij_idea_ultimate, pycharm). If not specified, downloads all enabled runtimes from config",
},
&cli.StringFlag{
Name: "version",
Expand Down Expand Up @@ -654,9 +654,9 @@ func initializeManager(configPath string, db *storage.DB, stdout, stderr *slog.L
"runtime", runtimeName,
"endoflife_product", runtimeConfig.EndOfLifeProduct,
"policy_file", runtimeConfig.PolicyFile)
case "pycharm_professional":
case "pycharm":
adapter := pycharmAdapter.NewAdapterWithConfig(&runtimeConfig, &cfg.Config, stdout, stderr)
if err := registry.Register("pycharm_professional", adapter); err != nil {
if err := registry.Register("pycharm", adapter); err != nil {
return nil, nil, fmt.Errorf("failed to register pycharm adapter: %w", err)
}
stdout.Info("registered runtime adapter",
Expand Down
4 changes: 2 additions & 2 deletions internal/config/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -290,7 +290,7 @@ func (c *Config) Validate() error {
// RuntimeSkipsPolicyFile reports runtimes that resolve versions from an upstream API and do not use policies/*.json.
func RuntimeSkipsPolicyFile(name string) bool {
switch strings.ToLower(strings.TrimSpace(name)) {
case "vscode", "intellij_idea_ultimate", "pycharm_professional":
case "vscode", "intellij_idea_ultimate", "pycharm":
return true
default:
return false
Expand All @@ -300,7 +300,7 @@ func RuntimeSkipsPolicyFile(name string) bool {
// RuntimeSkipsEndOfLifeProduct reports runtimes not indexed on endoflife.date; endoflife_product may be omitted.
func RuntimeSkipsEndOfLifeProduct(name string) bool {
switch strings.ToLower(strings.TrimSpace(name)) {
case "intellij_idea_ultimate", "pycharm_professional":
case "intellij_idea_ultimate", "pycharm":
return true
default:
return false
Expand Down
4 changes: 2 additions & 2 deletions internal/config/config_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -352,7 +352,7 @@ func TestRuntime_Validate(t *testing.T) {
expectError: false,
},
{
name: "pycharm_professional skips endoflife.date and policy",
name: "pycharm skips endoflife.date and policy",
runtime: Runtime{
Enabled: true,
EndOfLifeProduct: "",
Expand All @@ -361,7 +361,7 @@ func TestRuntime_Validate(t *testing.T) {
Enabled: false,
},
},
runtimeName: "pycharm_professional",
runtimeName: "pycharm",
expectError: false,
},
}
Expand Down
14 changes: 7 additions & 7 deletions internal/runtimes/pycharm/pycharm.go
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Package pycharm provides a PyCharm Professional runtime adapter using shared JetBrains runtime logic.
// Package pycharm provides a unified PyCharm runtime adapter using shared JetBrains runtime logic.
package pycharm

import (
Expand All @@ -10,26 +10,26 @@ import (
)

const (
// PyCharmProfessionalRuntime is the registry key for PyCharm Professional (PCP).
PyCharmProfessionalRuntime = "pycharm_professional"
defaultProductCode = "PCP"
// PyCharmRuntime is the registry key for the unified PyCharm product (PCP).
PyCharmRuntime = "pycharm"
defaultProductCode = "PCP"
)

// Adapter is a thin PyCharm wrapper around the shared JetBrains adapter.
type Adapter struct {
*jetbrains.Adapter
}

// NewAdapterWithConfig builds a PyCharm Professional adapter.
// NewAdapterWithConfig builds a unified PyCharm adapter.
func NewAdapterWithConfig(cfg *config.Runtime, globalCfg *config.GlobalConfig, stdout, stderr *slog.Logger) runtime.RuntimeProvider {
return &Adapter{
Adapter: jetbrains.NewAdapterWithConfig(cfg, globalCfg, jetbrains.ProductOptions{
RuntimeName: PyCharmProfessionalRuntime,
RuntimeName: PyCharmRuntime,
DefaultProductCode: defaultProductCode,
DefaultReleaseType: "release",
DefaultReleasesURL: "https://data.services.jetbrains.com/products/releases",
DefaultUserAgent: "cdprun/1.0 (PyCharm)",
ArtifactPrefix: "pycharm-professional",
ArtifactPrefix: "pycharm",
}, stdout, stderr),
}
}
4 changes: 2 additions & 2 deletions internal/runtimes/pycharm/pycharm_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -89,8 +89,8 @@ func TestAdapter_GetLatestVersion(t *testing.T) {
if latest.LatestPatch != "2099.1.1" {
t.Fatalf("LatestPatch = %s, want 2099.1.1", latest.LatestPatch)
}
if latest.RuntimeName != PyCharmProfessionalRuntime {
t.Fatalf("RuntimeName = %s, want %s", latest.RuntimeName, PyCharmProfessionalRuntime)
if latest.RuntimeName != PyCharmRuntime {
t.Fatalf("RuntimeName = %s, want %s", latest.RuntimeName, PyCharmRuntime)
}
}

Expand Down
32 changes: 28 additions & 4 deletions runtime-registry.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,9 @@ runtimes:
gpg:
enabled: true
signature_pattern: ".asc"
clamav:
enabled: true
image: "clamav/clamav-debian:latest"
endoflife:
product_name: "python"
check_eol: true
Expand Down Expand Up @@ -126,6 +129,9 @@ runtimes:
gpg:
enabled: true
signature_pattern: "SHASUMS256.txt.asc"
clamav:
enabled: true
image: "clamav/clamav-debian:latest"
endoflife:
product_name: "nodejs"
check_eol: true
Expand Down Expand Up @@ -197,6 +203,9 @@ runtimes:
gpg:
enabled: true
signature_pattern: "*.sig"
clamav:
enabled: true
image: "clamav/clamav-debian:latest"
audit_logging:
enabled: true
output_dir: "./verification-logs"
Expand Down Expand Up @@ -260,6 +269,9 @@ runtimes:
gpg:
enabled: true
signature_pattern: ".asc"
clamav:
enabled: true
image: "clamav/clamav-debian:latest"
endoflife:
product_name: "tomcat"
check_eol: true
Expand Down Expand Up @@ -332,6 +344,9 @@ runtimes:
gpg:
enabled: true
signature_pattern: ".asc"
clamav:
enabled: true
image: "clamav/clamav-debian:latest"
endoflife:
product_name: "yarn"
check_eol: true
Expand Down Expand Up @@ -401,6 +416,9 @@ runtimes:
gpg:
enabled: false
signature_pattern: ""
clamav:
enabled: true
image: "clamav/clamav-debian:latest"
endoflife:
product_name: "vscode"
check_eol: false
Expand Down Expand Up @@ -455,6 +473,9 @@ runtimes:
gpg:
enabled: false
signature_pattern: ""
clamav:
enabled: true
image: "clamav/clamav-debian:latest"
endoflife:
product_name: ""
check_eol: false
Expand All @@ -468,10 +489,10 @@ runtimes:
enabled: false
targets: []

pycharm_professional:
pycharm:
enabled: true
name: "PyCharm Professional"
description: "PyCharm Professional (PCP) — versions from JetBrains releases API only; not on endoflife.date"
name: "PyCharm"
description: "PyCharm (PCP) — unified product; versions from JetBrains releases API only; not on endoflife.date"
endoflife_product: ""
policy_file: ""
version_pattern: "major"
Expand Down Expand Up @@ -509,6 +530,9 @@ runtimes:
gpg:
enabled: false
signature_pattern: ""
clamav:
enabled: true
image: "clamav/clamav-debian:latest"
endoflife:
product_name: ""
check_eol: false
Expand All @@ -517,7 +541,7 @@ runtimes:
auto_release: true
github_repository: "Clean-Dependency-Project/cdprun"
draft_release: false
release_name_template: "PyCharm Professional - {version}"
release_name_template: "PyCharm - {version}"
packaging:
enabled: false
targets: []
Loading