Skip to content

Commit 67035a9

Browse files
Fixed the pycharm to universal image (#63)
1 parent cf02ce7 commit 67035a9

6 files changed

Lines changed: 44 additions & 20 deletions

File tree

internal/cli/cli.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -96,7 +96,7 @@ func NewApp() *cli.App {
9696
&cli.StringFlag{
9797
Name: "runtime",
9898
Aliases: []string{"r"},
99-
Usage: "runtime name (nodejs, python, tomcat, yarn, temurin, vscode, intellij_idea_ultimate, pycharm_professional). If not specified, downloads all enabled runtimes from config",
99+
Usage: "runtime name (nodejs, python, tomcat, yarn, temurin, vscode, intellij_idea_ultimate, pycharm). If not specified, downloads all enabled runtimes from config",
100100
},
101101
&cli.StringFlag{
102102
Name: "version",
@@ -654,9 +654,9 @@ func initializeManager(configPath string, db *storage.DB, stdout, stderr *slog.L
654654
"runtime", runtimeName,
655655
"endoflife_product", runtimeConfig.EndOfLifeProduct,
656656
"policy_file", runtimeConfig.PolicyFile)
657-
case "pycharm_professional":
657+
case "pycharm":
658658
adapter := pycharmAdapter.NewAdapterWithConfig(&runtimeConfig, &cfg.Config, stdout, stderr)
659-
if err := registry.Register("pycharm_professional", adapter); err != nil {
659+
if err := registry.Register("pycharm", adapter); err != nil {
660660
return nil, nil, fmt.Errorf("failed to register pycharm adapter: %w", err)
661661
}
662662
stdout.Info("registered runtime adapter",

internal/config/config.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -290,7 +290,7 @@ func (c *Config) Validate() error {
290290
// RuntimeSkipsPolicyFile reports runtimes that resolve versions from an upstream API and do not use policies/*.json.
291291
func RuntimeSkipsPolicyFile(name string) bool {
292292
switch strings.ToLower(strings.TrimSpace(name)) {
293-
case "vscode", "intellij_idea_ultimate", "pycharm_professional":
293+
case "vscode", "intellij_idea_ultimate", "pycharm":
294294
return true
295295
default:
296296
return false
@@ -300,7 +300,7 @@ func RuntimeSkipsPolicyFile(name string) bool {
300300
// RuntimeSkipsEndOfLifeProduct reports runtimes not indexed on endoflife.date; endoflife_product may be omitted.
301301
func RuntimeSkipsEndOfLifeProduct(name string) bool {
302302
switch strings.ToLower(strings.TrimSpace(name)) {
303-
case "intellij_idea_ultimate", "pycharm_professional":
303+
case "intellij_idea_ultimate", "pycharm":
304304
return true
305305
default:
306306
return false

internal/config/config_test.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -352,7 +352,7 @@ func TestRuntime_Validate(t *testing.T) {
352352
expectError: false,
353353
},
354354
{
355-
name: "pycharm_professional skips endoflife.date and policy",
355+
name: "pycharm skips endoflife.date and policy",
356356
runtime: Runtime{
357357
Enabled: true,
358358
EndOfLifeProduct: "",
@@ -361,7 +361,7 @@ func TestRuntime_Validate(t *testing.T) {
361361
Enabled: false,
362362
},
363363
},
364-
runtimeName: "pycharm_professional",
364+
runtimeName: "pycharm",
365365
expectError: false,
366366
},
367367
}
Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// Package pycharm provides a PyCharm Professional runtime adapter using shared JetBrains runtime logic.
1+
// Package pycharm provides a unified PyCharm runtime adapter using shared JetBrains runtime logic.
22
package pycharm
33

44
import (
@@ -10,26 +10,26 @@ import (
1010
)
1111

1212
const (
13-
// PyCharmProfessionalRuntime is the registry key for PyCharm Professional (PCP).
14-
PyCharmProfessionalRuntime = "pycharm_professional"
15-
defaultProductCode = "PCP"
13+
// PyCharmRuntime is the registry key for the unified PyCharm product (PCP).
14+
PyCharmRuntime = "pycharm"
15+
defaultProductCode = "PCP"
1616
)
1717

1818
// Adapter is a thin PyCharm wrapper around the shared JetBrains adapter.
1919
type Adapter struct {
2020
*jetbrains.Adapter
2121
}
2222

23-
// NewAdapterWithConfig builds a PyCharm Professional adapter.
23+
// NewAdapterWithConfig builds a unified PyCharm adapter.
2424
func NewAdapterWithConfig(cfg *config.Runtime, globalCfg *config.GlobalConfig, stdout, stderr *slog.Logger) runtime.RuntimeProvider {
2525
return &Adapter{
2626
Adapter: jetbrains.NewAdapterWithConfig(cfg, globalCfg, jetbrains.ProductOptions{
27-
RuntimeName: PyCharmProfessionalRuntime,
27+
RuntimeName: PyCharmRuntime,
2828
DefaultProductCode: defaultProductCode,
2929
DefaultReleaseType: "release",
3030
DefaultReleasesURL: "https://data.services.jetbrains.com/products/releases",
3131
DefaultUserAgent: "cdprun/1.0 (PyCharm)",
32-
ArtifactPrefix: "pycharm-professional",
32+
ArtifactPrefix: "pycharm",
3333
}, stdout, stderr),
3434
}
3535
}

internal/runtimes/pycharm/pycharm_test.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -89,8 +89,8 @@ func TestAdapter_GetLatestVersion(t *testing.T) {
8989
if latest.LatestPatch != "2099.1.1" {
9090
t.Fatalf("LatestPatch = %s, want 2099.1.1", latest.LatestPatch)
9191
}
92-
if latest.RuntimeName != PyCharmProfessionalRuntime {
93-
t.Fatalf("RuntimeName = %s, want %s", latest.RuntimeName, PyCharmProfessionalRuntime)
92+
if latest.RuntimeName != PyCharmRuntime {
93+
t.Fatalf("RuntimeName = %s, want %s", latest.RuntimeName, PyCharmRuntime)
9494
}
9595
}
9696

runtime-registry.yaml

Lines changed: 28 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,9 @@ runtimes:
5353
gpg:
5454
enabled: true
5555
signature_pattern: ".asc"
56+
clamav:
57+
enabled: true
58+
image: "clamav/clamav-debian:latest"
5659
endoflife:
5760
product_name: "python"
5861
check_eol: true
@@ -126,6 +129,9 @@ runtimes:
126129
gpg:
127130
enabled: true
128131
signature_pattern: "SHASUMS256.txt.asc"
132+
clamav:
133+
enabled: true
134+
image: "clamav/clamav-debian:latest"
129135
endoflife:
130136
product_name: "nodejs"
131137
check_eol: true
@@ -197,6 +203,9 @@ runtimes:
197203
gpg:
198204
enabled: true
199205
signature_pattern: "*.sig"
206+
clamav:
207+
enabled: true
208+
image: "clamav/clamav-debian:latest"
200209
audit_logging:
201210
enabled: true
202211
output_dir: "./verification-logs"
@@ -260,6 +269,9 @@ runtimes:
260269
gpg:
261270
enabled: true
262271
signature_pattern: ".asc"
272+
clamav:
273+
enabled: true
274+
image: "clamav/clamav-debian:latest"
263275
endoflife:
264276
product_name: "tomcat"
265277
check_eol: true
@@ -332,6 +344,9 @@ runtimes:
332344
gpg:
333345
enabled: true
334346
signature_pattern: ".asc"
347+
clamav:
348+
enabled: true
349+
image: "clamav/clamav-debian:latest"
335350
endoflife:
336351
product_name: "yarn"
337352
check_eol: true
@@ -401,6 +416,9 @@ runtimes:
401416
gpg:
402417
enabled: false
403418
signature_pattern: ""
419+
clamav:
420+
enabled: true
421+
image: "clamav/clamav-debian:latest"
404422
endoflife:
405423
product_name: "vscode"
406424
check_eol: false
@@ -455,6 +473,9 @@ runtimes:
455473
gpg:
456474
enabled: false
457475
signature_pattern: ""
476+
clamav:
477+
enabled: true
478+
image: "clamav/clamav-debian:latest"
458479
endoflife:
459480
product_name: ""
460481
check_eol: false
@@ -468,10 +489,10 @@ runtimes:
468489
enabled: false
469490
targets: []
470491

471-
pycharm_professional:
492+
pycharm:
472493
enabled: true
473-
name: "PyCharm Professional"
474-
description: "PyCharm Professional (PCP) — versions from JetBrains releases API only; not on endoflife.date"
494+
name: "PyCharm"
495+
description: "PyCharm (PCP) — unified product; versions from JetBrains releases API only; not on endoflife.date"
475496
endoflife_product: ""
476497
policy_file: ""
477498
version_pattern: "major"
@@ -509,6 +530,9 @@ runtimes:
509530
gpg:
510531
enabled: false
511532
signature_pattern: ""
533+
clamav:
534+
enabled: true
535+
image: "clamav/clamav-debian:latest"
512536
endoflife:
513537
product_name: ""
514538
check_eol: false
@@ -517,7 +541,7 @@ runtimes:
517541
auto_release: true
518542
github_repository: "Clean-Dependency-Project/cdprun"
519543
draft_release: false
520-
release_name_template: "PyCharm Professional - {version}"
544+
release_name_template: "PyCharm - {version}"
521545
packaging:
522546
enabled: false
523547
targets: []

0 commit comments

Comments
 (0)