Skip to content

feat: enable agent connection reports by default, remove flag (cherry-pick #16778) #16809

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
44 commits
Select commit Hold shift + click to select a range
172e523
feat(agent): wire up agentssh server to allow exec into container (#1…
johnstcn Feb 26, 2025
38c0e8a
fix(agent/agentssh): ensure RSA key generation always produces valid …
ThomasK33 Feb 26, 2025
c5a265f
feat(cli): add experimental rpty command (#16700)
johnstcn Feb 26, 2025
a2cc1b8
fix: display premium banner on audit page when license inactive (#16713)
mtojek Feb 26, 2025
2971957
ci: also restart tagged provisioner deployment (#16716)
johnstcn Feb 26, 2025
f1b357d
feat: support session audit log (#16703)
BrunoQuaresma Feb 26, 2025
b94d2cb
fix(coderd): handle deletes and links for new agent/app audit resourc…
mafredri Feb 26, 2025
7c035a4
fix: remove provisioners from deployment sidebar (#16717)
BrunoQuaresma Feb 26, 2025
7cd6e9c
fix: return provisioners in desc order and add limit to cli (#16720)
mafredri Feb 26, 2025
5295902
docs: clarified prometheus integration behavior (#16724)
michaelvp411 Feb 26, 2025
1cb864b
fix: allow viewOrgRoles for custom roles page (#16722)
jaaydenh Feb 26, 2025
81ef9e9
docs: document new feature stages (#16719)
EdwardAngert Feb 26, 2025
2aa749a
chore(cli): fix test flake caused by agent connect race (#16725)
johnstcn Feb 26, 2025
6b69635
chore: warn user without permissions to view org members (#16721)
jaaydenh Feb 26, 2025
5cdc13b
docs: fix broken links in feature-stages (#16727)
EdwardAngert Feb 26, 2025
b3d6755
docs: copy edit early access section in feature-stages doc (#16730)
EdwardAngert Feb 27, 2025
95363c9
fix(enterprise/coderd): remove useless provisioner daemon id from req…
johnstcn Feb 27, 2025
6dd51f9
chore: test metricscache on postgres (#16711)
DanielleMaywood Feb 27, 2025
4ba5a8a
feat(agent): add connection reporting for SSH and reconnecting PTY (#…
mafredri Feb 27, 2025
cccdf1e
feat: implement WorkspaceCreationBan org role (#16686)
Emyrk Feb 27, 2025
464fccd
chore: create collapsible summary component (#16705)
jaaydenh Feb 27, 2025
bf5b002
fix: add org role read permissions to site wide template admins and a…
jaaydenh Feb 27, 2025
91a4a98
chore: add an unassign action for roles (#16728)
aslilac Feb 27, 2025
0ea0601
fix: handle undefined job while updating build progress (#16732)
mtojek Feb 27, 2025
7e33902
chore: use org-scoped roles for organization groups and members e2e t…
aslilac Feb 27, 2025
b23e05b
fix(vpn): fail early if wintun.dll is not present (#16707)
deansheather Feb 28, 2025
3997eee
chore: update tailscale (#16737)
deansheather Feb 28, 2025
64fec8b
feat: include winres metadata in Windows binaries (#16706)
deansheather Feb 28, 2025
ec44f06
feat(cli): allow SSH command to connect to running container (#16726)
johnstcn Feb 28, 2025
6889ad2
fix(agent/agentcontainers): remove empty warning if no containers exi…
johnstcn Feb 28, 2025
e27953d
fix(site): add a beta badge for presets (#16751)
SasSwart Feb 28, 2025
930816f
fix: locate Terraform entrypoint file (#16753)
mtojek Feb 28, 2025
4216e28
fix: editor: fallback to default entrypoint (#16757)
mtojek Feb 28, 2025
fc2815c
docs: fix anchor and repo links (#16555)
guspan-tanadi Mar 2, 2025
ca23abe
feat(provisioner): add support for workspace_owner_rbac_roles (#16407)
nxf5025 Mar 2, 2025
d0e2060
feat(agent): add second SSH listener on port 22 (#16627)
ThomasK33 Mar 3, 2025
c074f77
feat: add notifications inbox db (#16599)
defelmnq Mar 3, 2025
a5842e5
docs: document default GitHub OAuth2 configuration and device flow (#…
hugodutka Mar 3, 2025
9c5d496
docs: suggest disabling the default GitHub OAuth2 provider on k8s (#1…
hugodutka Mar 3, 2025
0f4f6bd
docs: describe default sign up behavior with GitHub (#16765)
hugodutka Mar 3, 2025
88f0131
fix: use dbtime in dbmem query to fix flake (#16773)
ethanndickson Mar 3, 2025
04c3396
refactor: replace `golang.org/x/exp/slices` with `slices` (#16772)
Juneezee Mar 3, 2025
ca23abc
chore(cli): fix test flake in TestSSH_Container/NotFound (#16771)
johnstcn Mar 3, 2025
7dc05cc
feat: enable agent connection reports by default, remove flag
mafredri Mar 3, 2025
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
Prev Previous commit
Next Next commit
chore: use org-scoped roles for organization groups and members e2e t…
…ests (#16691)
  • Loading branch information
aslilac authored Feb 27, 2025
commit 7e339021c13aa7788edb2c4519e37d14467d68b6
32 changes: 29 additions & 3 deletions site/e2e/api.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@ import { expect } from "@playwright/test";
import { API, type DeploymentConfig } from "api/api";
import type { SerpentOption } from "api/typesGenerated";
import { formatDuration, intervalToDuration } from "date-fns";
import { coderPort } from "./constants";
import { findSessionToken, randomName } from "./helpers";
import { coderPort, defaultPassword } from "./constants";
import { type LoginOptions, findSessionToken, randomName } from "./helpers";

let currentOrgId: string;

Expand All @@ -29,14 +29,40 @@ export const createUser = async (...orgIds: string[]) => {
email: `${name}@coder.com`,
username: name,
name: name,
password: "s3cure&password!",
password: defaultPassword,
login_type: "password",
organization_ids: orgIds,
user_status: null,
});

return user;
};

export const createOrganizationMember = async (
orgRoles: Record<string, string[]>,
): Promise<LoginOptions> => {
const name = randomName();
const user = await API.createUser({
email: `${name}@coder.com`,
username: name,
name: name,
password: defaultPassword,
login_type: "password",
organization_ids: Object.keys(orgRoles),
user_status: null,
});

for (const [org, roles] of Object.entries(orgRoles)) {
API.updateOrganizationMemberRoles(org, user.id, roles);
}

return {
username: user.username,
email: user.email,
password: defaultPassword,
};
};

export const createGroup = async (orgId: string) => {
const name = randomName();
const group = await API.createGroup(orgId, {
Expand Down
7 changes: 7 additions & 0 deletions site/e2e/constants.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ export const coderdPProfPort = 6062;

// The name of the organization that should be used by default when needed.
export const defaultOrganizationName = "coder";
export const defaultOrganizationId = "00000000-0000-0000-0000-000000000000";
export const defaultPassword = "SomeSecurePassword!";

// Credentials for users
Expand All @@ -30,6 +31,12 @@ export const users = {
email: "templateadmin@coder.com",
roles: ["Template Admin"],
},
userAdmin: {
username: "user-admin",
password: defaultPassword,
email: "useradmin@coder.com",
roles: ["User Admin"],
},
auditor: {
username: "auditor",
password: defaultPassword,
Expand Down
29 changes: 28 additions & 1 deletion site/e2e/helpers.ts
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ export function requireTerraformProvisioner() {
test.skip(!requireTerraformTests);
}

type LoginOptions = {
export type LoginOptions = {
username: string;
email: string;
password: string;
Expand Down Expand Up @@ -1127,3 +1127,30 @@ export async function createOrganization(page: Page): Promise<{

return { name, displayName, description };
}

/**
* @param organization organization name
* @param user user email or username
*/
export async function addUserToOrganization(
page: Page,
organization: string,
user: string,
roles: string[] = [],
): Promise<void> {
await page.goto(`/organizations/${organization}`, {
waitUntil: "domcontentloaded",
});

await page.getByPlaceholder("User email or username").fill(user);
await page.getByRole("option", { name: user }).click();
await page.getByRole("button", { name: "Add user" }).click();
const addedRow = page.locator("tr", { hasText: user });
await expect(addedRow).toBeVisible();

await addedRow.getByLabel("Edit user roles").click();
for (const role of roles) {
await page.getByText(role).click();
}
await page.mouse.click(10, 10); // close the popover by clicking outside of it
}
15 changes: 12 additions & 3 deletions site/e2e/tests/organizationGroups.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,11 @@ import { expect, test } from "@playwright/test";
import {
createGroup,
createOrganization,
createOrganizationMember,
createUser,
setupApiCalls,
} from "../api";
import { defaultOrganizationName } from "../constants";
import { defaultOrganizationId, defaultOrganizationName } from "../constants";
import { expectUrl } from "../expectUrl";
import { login, randomName, requiresLicense } from "../helpers";
import { beforeCoderTest } from "../hooks";
Expand All @@ -32,6 +33,11 @@ test("create group", async ({ page }) => {

// Create a new organization
const org = await createOrganization();
const orgUserAdmin = await createOrganizationMember({
[org.id]: ["organization-user-admin"],
});

await login(page, orgUserAdmin);
await page.goto(`/organizations/${org.name}`);

// Navigate to groups page
Expand Down Expand Up @@ -64,8 +70,7 @@ test("create group", async ({ page }) => {
await expect(addedRow).toBeVisible();

// Ensure we can't add a user who isn't in the org
const otherOrg = await createOrganization();
const personToReject = await createUser(otherOrg.id);
const personToReject = await createUser(defaultOrganizationId);
await page
.getByPlaceholder("User email or username")
.fill(personToReject.email);
Expand Down Expand Up @@ -93,8 +98,12 @@ test("change quota settings", async ({ page }) => {
// Create a new organization and group
const org = await createOrganization();
const group = await createGroup(org.id);
const orgUserAdmin = await createOrganizationMember({
[org.id]: ["organization-user-admin"],
});

// Go to settings
await login(page, orgUserAdmin);
await page.goto(`/organizations/${org.name}/groups/${group.name}`);
await page.getByRole("button", { name: "Settings", exact: true }).click();
expectUrl(page).toHavePathName(
Expand Down
20 changes: 9 additions & 11 deletions site/e2e/tests/organizationMembers.spec.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import { expect, test } from "@playwright/test";
import { setupApiCalls } from "../api";
import {
addUserToOrganization,
createOrganization,
createUser,
login,
Expand All @@ -18,25 +19,22 @@ test("add and remove organization member", async ({ page }) => {
requiresLicense();

// Create a new organization
const { displayName } = await createOrganization(page);
const { name: orgName, displayName } = await createOrganization(page);

// Navigate to members page
await page.getByRole("link", { name: "Members" }).click();
await expect(page).toHaveTitle(`Members - ${displayName} - Coder`);

// Add a user to the org
const personToAdd = await createUser(page);
await page.getByPlaceholder("User email or username").fill(personToAdd.email);
await page.getByRole("option", { name: personToAdd.email }).click();
await page.getByRole("button", { name: "Add user" }).click();
const addedRow = page.locator("tr", { hasText: personToAdd.email });
await expect(addedRow).toBeVisible();
// This must be done as an admin, because you can't assign a role that has more
// permissions than you, even if you have the ability to assign roles.
await addUserToOrganization(page, orgName, personToAdd.email, [
"Organization User Admin",
"Organization Template Admin",
]);

// Give them a role
await addedRow.getByLabel("Edit user roles").click();
await page.getByText("Organization User Admin").click();
await page.getByText("Organization Template Admin").click();
await page.mouse.click(10, 10); // close the popover by clicking outside of it
const addedRow = page.locator("tr", { hasText: personToAdd.email });
await expect(addedRow.getByText("Organization User Admin")).toBeVisible();
await expect(addedRow.getByText("+1 more")).toBeVisible();

Expand Down
Loading