Skip to content

Commit 65cfd23

Browse files
authored
fix: remove unresolved merge conflict markers from rebase (#33)
* fix: remove unresolved merge conflict markers from rebase * fix: restore partial-failure warning banner, rename duplicate test suite, restore changelog dropped in rebase for 2.1.0 features
1 parent 1a64d3f commit 65cfd23

5 files changed

Lines changed: 35 additions & 103 deletions

File tree

CHANGELOG.md

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,24 @@
1+
## 2.1.0 - March 2026
2+
### Terraform Export
3+
4+
#### Export Repository as Terraform
5+
- "Export as Terraform" context menu command on repository nodes generates a complete Cloudsmith Terraform provider configuration.
6+
- Exports `cloudsmith_repository` with all base non-default settings
7+
- Exports all configured upstreams as `cloudsmith_repository_upstream` resources with format type, URL, mode, priority, and active state.
8+
- Supports all upstream formats.
9+
- Exports `cloudsmith_repository_retention_rule` when retention is configured.
10+
- Uses Terraform resource references (`data.cloudsmith_namespace`, `cloudsmith_repository.slug_perm`) for portable, import-ready configurations.
11+
- Auth secrets are never exported as plaintext. Upstream credentials use Terraform variable placeholders with `sensitive = true`.
12+
- Generated HCL opens in a new editor tab for review before saving.
13+
14+
#### Upstream Reliability
15+
- Consolidated all upstream data fetching into a single shared helper across inline indicators, WebView, and Terraform export.
16+
- Hardened upstream cache validation: malformed entries are evicted, expired entries force refetch, and cache write failures are non-fatal.
17+
- Inline upstream count now reflects all configured formats, not just formats inferred from loaded packages.
18+
19+
#### License Resolution Reliability
20+
- Fixed an issue causing licenses to not properly display in certain situations
21+
122
## 2.0.0 - March 2026
223
### Package Intelligence Platform
324

extension.js

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -18,15 +18,9 @@ const { UpstreamDetailProvider } = require("./views/upstreamDetailProvider");
1818
const { PromotionProvider } = require("./views/promotionProvider");
1919
const { SearchQueryBuilder } = require("./util/searchQueryBuilder");
2020
const { formatApiError } = require("./util/errorFormatter");
21-
<<<<<<< HEAD
2221
const { LicenseClassifier } = require("./util/licenseClassifier");
23-
=======
2422
const { fetchRepositoryUpstreams, generateTerraformConfig } = require("./util/terraformExporter");
25-
<<<<<<< HEAD
26-
>>>>>>> 52ddc2b (feat: export repository as Terraform)
27-
=======
2823
const { SUPPORTED_UPSTREAM_FORMATS } = require("./util/upstreamFormats");
29-
>>>>>>> 50c8bac (fix: consolidate upstream fetch and fix WebView/Terraform export consumers)
3024
const recentPackages = require("./util/recentPackages");
3125

3226
let exportTerraformAbortController = null;

test/upstreamChecker.test.js

Lines changed: 9 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,16 @@
11
const assert = require("assert");
2-
<<<<<<< HEAD
3-
<<<<<<< HEAD
42
const { CloudsmithAPI } = require("../util/cloudsmithAPI");
53
const { CredentialManager } = require("../util/credentialManager");
64
const {
7-
UpstreamChecker,
5+
isBenignUpstreamFormatError,
86
SUPPORTED_UPSTREAM_FORMATS,
7+
UpstreamChecker,
98
} = require("../util/upstreamChecker");
9+
const {
10+
SUPPORTED_UPSTREAM_FORMATS: SHARED_SUPPORTED_UPSTREAM_FORMATS,
11+
} = require("../util/upstreamFormats");
1012

11-
suite("UpstreamChecker Test Suite", () => {
13+
suite("UpstreamChecker repository upstream cache", () => {
1214
let originalMakeRequest;
1315
let originalGetApiKey;
1416
let formatResponses;
@@ -237,20 +239,10 @@ suite("UpstreamChecker Test Suite", () => {
237239
} finally {
238240
context.globalState.update = originalUpdate;
239241
}
240-
=======
241-
const { SUPPORTED_UPSTREAM_FORMATS, UpstreamChecker } = require("../util/upstreamChecker");
242-
=======
243-
const {
244-
isBenignUpstreamFormatError,
245-
SUPPORTED_UPSTREAM_FORMATS,
246-
UpstreamChecker,
247-
} = require("../util/upstreamChecker");
248-
const {
249-
SUPPORTED_UPSTREAM_FORMATS: SHARED_SUPPORTED_UPSTREAM_FORMATS,
250-
} = require("../util/upstreamFormats");
251-
>>>>>>> 50c8bac (fix: consolidate upstream fetch and fix WebView/Terraform export consumers)
242+
});
243+
});
252244

253-
suite("UpstreamChecker Test Suite", () => {
245+
suite("UpstreamChecker shared helper and format handling", () => {
254246
function createContext() {
255247
const store = new Map();
256248
const updates = [];
@@ -546,7 +538,6 @@ suite("UpstreamChecker Test Suite", () => {
546538

547539
assert.strictEqual(result.data.length, 0);
548540
assert.ok(result.error.includes("python"));
549-
>>>>>>> 52ddc2b (feat: export repository as Terraform)
550541
});
551542

552543
test("does not cache non-benign empty upstream results", async () => {

util/upstreamChecker.js

Lines changed: 3 additions & 49 deletions
Original file line numberDiff line numberDiff line change
@@ -4,52 +4,13 @@
44
const { CloudsmithAPI } = require("./cloudsmithAPI");
55
const { CredentialManager } = require("./credentialManager");
66
const { SearchQueryBuilder } = require("./searchQueryBuilder");
7-
<<<<<<< HEAD
8-
9-
const SUPPORTED_UPSTREAM_FORMATS = [
10-
<<<<<<< HEAD
11-
"deb", "docker", "maven", "npm", "python",
12-
"ruby", "dart", "helm", "nuget", "cargo",
13-
"rpm", "cran", "swift", "go", "hex",
14-
"composer", "conda", "conan", "p2", "terraform",
15-
"raw",
16-
];
17-
const UPSTREAM_FETCH_BATCH_SIZE = 5;
18-
const UPSTREAM_CACHE_TTL_MS = 10 * 60 * 1000; // 10 minutes
19-
const REPOSITORY_UPSTREAM_CACHE_KEY_PREFIX = "cloudsmith-upstreams:v2";
20-
=======
21-
"alpine",
22-
"cargo",
23-
"cocoapods",
24-
"composer",
25-
"conda",
26-
"cran",
27-
"dart",
28-
"deb",
29-
"docker",
30-
"generic",
31-
"go",
32-
"helm",
33-
"hex",
34-
"huggingface",
35-
"luarocks",
36-
"maven",
37-
"npm",
38-
"nuget",
39-
"python",
40-
"rpm",
41-
"ruby",
42-
"swift",
43-
"vagrant",
44-
];
45-
=======
467
const {
478
getSupportedUpstreamFormats,
489
SUPPORTED_UPSTREAM_FORMATS,
4910
} = require("./upstreamFormats");
50-
>>>>>>> 50c8bac (fix: consolidate upstream fetch and fix WebView/Terraform export consumers)
5111
const UPSTREAM_CACHE_TTL_MS = 10 * 60 * 1000;
5212
const UPSTREAM_FETCH_BATCH_SIZE = 5;
13+
const REPOSITORY_UPSTREAM_CACHE_KEY_PREFIX = "cloudsmith-upstreams:v2";
5314
const BENIGN_UPSTREAM_FORMAT_STATUS_CODES = new Set([400, 404, 405, 422]);
5415

5516
function isCacheObjectRecord(value) {
@@ -283,7 +244,6 @@ async function fetchFormatUpstreams(api, workspace, repo, format, apiKey, signal
283244
return { format, status: "failed", error: message, upstreams: [] };
284245
}
285246
}
286-
>>>>>>> 52ddc2b (feat: export repository as Terraform)
287247

288248
class UpstreamChecker {
289249
constructor(context) {
@@ -905,13 +865,6 @@ class UpstreamChecker {
905865
}
906866
}
907867

908-
<<<<<<< HEAD
909-
module.exports = {
910-
UpstreamChecker,
911-
SUPPORTED_UPSTREAM_FORMATS,
912-
UPSTREAM_FETCH_BATCH_SIZE,
913-
UPSTREAM_CACHE_TTL_MS,
914-
=======
915868
async function getAllUpstreamData(context, workspace, repo, options = {}) {
916869
const checker = new UpstreamChecker(context);
917870
return checker.getAllUpstreamData(workspace, repo, options);
@@ -928,5 +881,6 @@ module.exports = {
928881
isBenignUpstreamFormatError,
929882
SUPPORTED_UPSTREAM_FORMATS,
930883
UpstreamChecker,
931-
>>>>>>> 52ddc2b (feat: export repository as Terraform)
884+
UPSTREAM_FETCH_BATCH_SIZE,
885+
UPSTREAM_CACHE_TTL_MS,
932886
};

views/upstreamDetailProvider.js

Lines changed: 2 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -1,24 +1,12 @@
11
const vscode = require("vscode");
2-
<<<<<<< HEAD
3-
<<<<<<< HEAD
4-
const {
5-
UpstreamChecker,
6-
SUPPORTED_UPSTREAM_FORMATS,
7-
} = require("../util/upstreamChecker");
8-
=======
9-
const { SUPPORTED_UPSTREAM_FORMATS, getAllUpstreamData } = require("../util/upstreamChecker");
10-
=======
112
const { getAllUpstreamData } = require("../util/upstreamChecker");
123
const { SUPPORTED_UPSTREAM_FORMATS } = require("../util/upstreamFormats");
13-
>>>>>>> 50c8bac (fix: consolidate upstream fetch and fix WebView/Terraform export consumers)
144

155
const SUPPORTED_FORMATS = SUPPORTED_UPSTREAM_FORMATS;
16-
>>>>>>> 52ddc2b (feat: export repository as Terraform)
176

187
class UpstreamDetailProvider {
198
constructor(context) {
209
this.context = context;
21-
this.upstreamChecker = new UpstreamChecker(context);
2210
this._panel = null;
2311
this._abortController = null;
2412
this._requestId = 0;
@@ -44,19 +32,11 @@ class UpstreamDetailProvider {
4432
panel.title = `Upstreams: ${repoName}`;
4533
panel.webview.html = this._getLoadingHtml(workspace, repoSlug, repoName);
4634

47-
<<<<<<< HEAD
48-
const fetchState = await this.upstreamChecker.getRepositoryUpstreamState(
49-
workspace,
50-
repoSlug,
51-
{ signal: abortController.signal }
52-
);
53-
=======
5435
const fetchState = await this._fetchGroupedUpstreams(workspace, repoSlug, abortController.signal);
5536

5637
if (!fetchState) {
5738
return;
5839
}
59-
>>>>>>> 52ddc2b (feat: export repository as Terraform)
6040

6141
if (!this._canRender(panel, requestId) || abortController.signal.aborted) {
6242
return;
@@ -98,8 +78,6 @@ class UpstreamDetailProvider {
9878
return panel;
9979
}
10080

101-
<<<<<<< HEAD
102-
=======
10381
async _fetchGroupedUpstreams(workspace, repoSlug, signal) {
10482
const upstreamData = await getAllUpstreamData(this.context, workspace, repoSlug, { signal });
10583
if (upstreamData === null || signal.aborted) {
@@ -138,10 +116,8 @@ class UpstreamDetailProvider {
138116
successfulFormats: typeof upstreamData.successfulFormats === "number"
139117
? upstreamData.successfulFormats
140118
: 0,
141-
};
119+
};
142120
}
143-
144-
>>>>>>> 52ddc2b (feat: export repository as Terraform)
145121
_abortInFlightRequest() {
146122
if (this._abortController) {
147123
this._abortController.abort();
@@ -219,13 +195,9 @@ class UpstreamDetailProvider {
219195
const contentHtml = hasLoadedUpstreams
220196
? formatSections.join("\n")
221197
: this._getEmptyOrErrorState(hasFailures, successfulFormats);
222-
<<<<<<< HEAD
223-
const warningHtml = hasFailures && hasLoadedUpstreams
198+
const warningHtml = failedFormats.length > 0 && hasLoadedUpstreams
224199
? `<div class="warning-banner">Some upstream data could not be loaded.</div>`
225200
: "";
226-
=======
227-
const warningHtml = "";
228-
>>>>>>> 52ddc2b (feat: export repository as Terraform)
229201

230202
return `<!DOCTYPE html>
231203
<html lang="en">

0 commit comments

Comments
 (0)