Skip to content

Commit 80d33f1

Browse files
authored
trustpub: Show "Trusted Publishing" crate settings for everyone (#11532)
The feedback on our semi-public testing period has been positive, so let's make this a public testing period now.
1 parent 73eb0bf commit 80d33f1

File tree

3 files changed

+45
-52
lines changed

3 files changed

+45
-52
lines changed

app/templates/crate/settings/index.hbs

Lines changed: 39 additions & 42 deletions
Original file line numberDiff line numberDiff line change
@@ -54,51 +54,48 @@
5454
{{/each}}
5555
</div>
5656

57-
{{! The "Trusted Publishing" section is hidden for now until we make this feature publicly available. }}
58-
{{#if this.githubConfigs}}
59-
<div local-class="header">
60-
<h2>Trusted Publishing</h2>
61-
<div>
62-
<LinkTo @route="docs.trusted-publishing" class="button button--tan button--small" data-test-trusted-publishing-docs-button>
63-
Learn more
64-
</LinkTo>
65-
<LinkTo @route="crate.settings.new-trusted-publisher" class="button button--small" data-test-add-trusted-publisher-button>
66-
Add
67-
</LinkTo>
68-
</div>
57+
<div local-class="header">
58+
<h2>Trusted Publishing</h2>
59+
<div>
60+
<LinkTo @route="docs.trusted-publishing" class="button button--tan button--small" data-test-trusted-publishing-docs-button>
61+
Learn more
62+
</LinkTo>
63+
<LinkTo @route="crate.settings.new-trusted-publisher" class="button button--small" data-test-add-trusted-publisher-button>
64+
Add
65+
</LinkTo>
6966
</div>
67+
</div>
7068

71-
<table local-class="trustpub" data-test-trusted-publishing>
72-
<thead>
73-
<tr>
74-
<th>Publisher</th>
75-
<th>Details</th>
76-
<th></th>
69+
<table local-class="trustpub" data-test-trusted-publishing>
70+
<thead>
71+
<tr>
72+
<th>Publisher</th>
73+
<th>Details</th>
74+
<th><span class="sr-only">Actions</span></th>
75+
</tr>
76+
</thead>
77+
<tbody>
78+
{{#each this.githubConfigs as |config|}}
79+
<tr data-test-github-config={{config.id}}>
80+
<td>GitHub</td>
81+
<td local-class="details">
82+
<strong>Repository:</strong> <a href="https://github.com/{{config.repository_owner}}/{{config.repository_name}}" target="_blank" rel="noopener noreferrer">{{config.repository_owner}}/{{config.repository_name}}</a><br>
83+
<strong>Workflow:</strong> <a href="https://github.com/{{config.repository_owner}}/{{config.repository_name}}/blob/HEAD/.github/workflows/{{config.workflow_filename}}" target="_blank" rel="noopener noreferrer">{{config.workflow_filename}}</a><br>
84+
{{#if config.environment}}
85+
<strong>Environment:</strong> {{config.environment}}
86+
{{/if}}
87+
</td>
88+
<td local-class="actions">
89+
<button type="button" class="button button--small" data-test-remove-config-button {{on "click" (perform this.removeConfigTask config)}}>Remove</button>
90+
</td>
7791
</tr>
78-
</thead>
79-
<tbody>
80-
{{#each this.githubConfigs as |config|}}
81-
<tr data-test-github-config={{config.id}}>
82-
<td>GitHub</td>
83-
<td local-class="details">
84-
<strong>Repository:</strong> <a href="https://github.com/{{config.repository_owner}}/{{config.repository_name}}" target="_blank" rel="noopener noreferrer">{{config.repository_owner}}/{{config.repository_name}}</a><br>
85-
<strong>Workflow:</strong> <a href="https://github.com/{{config.repository_owner}}/{{config.repository_name}}/blob/HEAD/.github/workflows/{{config.workflow_filename}}" target="_blank" rel="noopener noreferrer">{{config.workflow_filename}}</a><br>
86-
{{#if config.environment}}
87-
<strong>Environment:</strong> {{config.environment}}
88-
{{/if}}
89-
</td>
90-
<td local-class="actions">
91-
<button type="button" class="button button--small" data-test-remove-config-button {{on "click" (perform this.removeConfigTask config)}}>Remove</button>
92-
</td>
93-
</tr>
94-
{{else}}
95-
<tr data-test-no-config>
96-
<td colspan="3">No trusted publishers configured for this crate.</td>
97-
</tr>
98-
{{/each}}
99-
</tbody>
100-
</table>
101-
{{/if}}
92+
{{else}}
93+
<tr data-test-no-config>
94+
<td colspan="3">No trusted publishers configured for this crate.</td>
95+
</tr>
96+
{{/each}}
97+
</tbody>
98+
</table>
10299

103100
<h2 local-class="header">Danger Zone</h2>
104101

e2e/routes/crate/settings.spec.ts

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -51,11 +51,9 @@ test.describe('Route | crate.settings', { tag: '@routes' }, () => {
5151
await expect(page.locator(`[data-test-owner-user="${user.login}"]`)).toBeVisible();
5252
await expect(page.locator('[data-test-remove-owner-button]')).toBeVisible();
5353

54-
// Disabled for now, until we make this feature publicly available
55-
// await expect(page.locator('[data-test-trusted-publishing]')).toBeVisible();
56-
// await expect(page.locator('[data-test-no-config]')).toBeVisible();
57-
// await expect(page.locator('[data-test-github-config]')).not.toBeVisible();
58-
await expect(page.locator('[data-test-trusted-publishing]')).not.toBeVisible();
54+
await expect(page.locator('[data-test-trusted-publishing]')).toBeVisible();
55+
await expect(page.locator('[data-test-no-config]')).toBeVisible();
56+
await expect(page.locator('[data-test-github-config]')).not.toBeVisible();
5957

6058
await expect(page.locator('[data-test-delete-button]')).toBeVisible();
6159
});

tests/routes/crate/settings-test.js

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -55,11 +55,9 @@ module('Route | crate.settings', hooks => {
5555
assert.dom(`[data-test-owner-user="${user.login}"]`).exists();
5656
assert.dom('[data-test-remove-owner-button]').exists();
5757

58-
// Disabled for now, until we make this feature publicly available
59-
// assert.dom('[data-test-trusted-publishing]').exists();
60-
// assert.dom('[data-test-no-config]').exists();
61-
// assert.dom('[data-test-github-config]').doesNotExist();
62-
assert.dom('[data-test-trusted-publishing]').doesNotExist();
58+
assert.dom('[data-test-trusted-publishing]').exists();
59+
assert.dom('[data-test-no-config]').exists();
60+
assert.dom('[data-test-github-config]').doesNotExist();
6361

6462
assert.dom('[data-test-delete-button]').exists();
6563
});

0 commit comments

Comments
 (0)