Skip to content
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

Fix not updating arn role #116

Merged
merged 6 commits into from
Nov 21, 2024
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
9 changes: 7 additions & 2 deletions libs/data-access/admin-api/src/lib/api/client.ts
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ export type QueryOptions<
Method extends SupportedMethods<Path>
> = UseQueryOptions<
FetchResponse<paths[Path][Method], {}, 'application/json'>['data'],
FetchResponse<paths[Path][Method], {}, 'application/json'>['error']
RestateError | Error
>;

type QueryFn<
Expand All @@ -106,7 +106,7 @@ export type MutationOptions<
Body extends OperationBody<Path, Method>
> = UseMutationOptions<
FetchResponse<paths[Path][Method], {}, 'application/json'>['data'],
FetchResponse<paths[Path][Method], {}, 'application/json'>['error'],
RestateError | Error,
{
parameters?: Parameters;
body?: Body;
Expand Down Expand Up @@ -148,6 +148,8 @@ export function adminApi<
queryFn: QueryFn<Path, Method>;
queryKey: QueryKey<Path, Method>;
meta: Record<string, unknown>;
refetchOnMount?: boolean;
staleTime?: number;
};
export function adminApi<
Path extends keyof paths,
Expand Down Expand Up @@ -187,6 +189,8 @@ export function adminApi<
queryFn: QueryFn<Path, Method>;
queryKey: QueryKey<Path, Method>;
meta: Record<string, unknown>;
refetchOnMount?: boolean;
staleTime?: number;
}
| {
mutationFn: MutationFn<Path, Method, Parameters, Body>;
Expand Down Expand Up @@ -215,6 +219,7 @@ export function adminApi<
);
return data;
},
refetchOnMount: true,
};
} else {
return {
Expand Down
3 changes: 3 additions & 0 deletions libs/data-access/admin-api/src/lib/api/hooks.ts
Original file line number Diff line number Diff line change
Expand Up @@ -155,6 +155,7 @@ export function useServiceDetails(
});

const results = useQuery({
staleTime: 0,
...queryOptions,
...options,
});
Expand All @@ -173,6 +174,7 @@ export function useDeploymentDetails(
});

const results = useQuery({
staleTime: 0,
...queryOptions,
...options,
});
Expand Down Expand Up @@ -221,6 +223,7 @@ export function useServiceOpenApi(
});

const results = useQuery({
staleTime: 0,
...queryOptions,
...options,
});
Expand Down
2 changes: 1 addition & 1 deletion libs/features/overview-route/src/lib/Details/Service.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -179,7 +179,7 @@ function ServiceForm({
<ServicePlaygroundTrigger
service={data?.name}
className=""
variant="secondary"
variant="primary"
/>
)}
</div>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,11 +1,16 @@
import { FormFieldInput } from '@restate/ui/form-field';
import { useRegisterDeploymentContext } from './Context';

export function AssumeARNRole() {
const { updateAssumeRoleArn, assumeRoleArn } = useRegisterDeploymentContext();

return (
<FormFieldInput
name="assume_role_arn"
placeholder="arn:aws:sts::{acc}:assumed-role/{role}/{func}"
pattern="^arn:aws:sts::(\d{12}):assumed-role\/([^\/]+)\/([^\/]+)$"
value={assumeRoleArn}
onChange={updateAssumeRoleArn}
label={
<>
<span slot="title">Assume role ARN</span>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ import {
import { useDialog } from '@restate/ui/dialog';
import { getEndpoint } from '../types';
import { showSuccessNotification } from '@restate/ui/notification';
import { RestateError } from '@restate/util/errors';

type NavigateToAdvancedAction = {
type: 'NavigateToAdvancedAction';
Expand Down Expand Up @@ -88,13 +89,7 @@ interface DeploymentRegistrationContextInterface {
updateAssumeRoleArn?: (value: string) => void;
updateUseHttp11Arn?: (value: boolean) => void;
updateShouldForce?: (value: boolean) => void;
error:
| {
message: string;
restate_code?: string | null;
}
| null
| undefined;
error: RestateError | Error | null | undefined;
}

type State = Pick<
Expand Down
2 changes: 1 addition & 1 deletion libs/features/overview-route/src/lib/RestateServer.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ export function RestateServer({
}: PropsWithChildren<{ className?: string }>) {
return (
<div className={className}>
<Button className="hidden md:flex w-[150px] h-[150px] focus:outline-none bg-transparent group hover:bg-transparent pressed:bg-transparent shadow-none py-0 px-0 border-none hover:scale-105 pressed:scale-95 pressed:drop-shadow-md">
<Button className="hidden md:flex w-[150px] h-[150px] focus:outline-none bg-none group hover:bg-transparent pressed:bg-transparent shadow-none py-0 px-0 border-none hover:scale-105 pressed:scale-95 pressed:drop-shadow-md">
<svg
viewBox="0 0 120 120"
fill="none"
Expand Down
2 changes: 1 addition & 1 deletion libs/features/overview-route/src/lib/ServicePlayground.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import { tv } from 'tailwind-variants';
import { API } from './StopLight';

const styles = tv({
base: 'px-1.5 py-0.5 text-xs text-gray-600 font-normal font-sans rounded-md flex items-center gap-1',
base: 'px-1.5 py-0.5 text-xs font-normal font-sans rounded-md flex items-center gap-1',
});
export function ServicePlaygroundTrigger({
service,
Expand Down
2 changes: 1 addition & 1 deletion libs/ui/button/src/lib/Button.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ const styles = tv({
variants: {
variant: {
primary:
'bg-blue-600 hover:bg-blue-700 pressed:bg-blue-800 text-white shadow-sm',
'bg-gradient-to-b from-blue-600/90 to-blue-600 hover:bg-blue-700 pressed:bg-blue-800 text-white shadow-[inset_0_1px_0_0_rgba(255,255,255,0.2)] drop-shadow-sm hover:shadow-none pressed:shadow-none',
secondary: 'bg-white hover:bg-gray-100 pressed:bg-gray-200 text-gray-800',
destructive: 'bg-red-700 hover:bg-red-800 pressed:bg-red-900 text-white',
icon: 'shadow-none border-0 p-1 flex items-center justify-center text-gray-600 hover:bg-black/[5%] pressed:bg-black/10 disabled:bg-transparent',
Expand Down
9 changes: 8 additions & 1 deletion scripts/typecheck.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
const { execSync } = require('child_process');

const projects = execSync('pnpm nx show projects --affected --json');
let isFailed = false;
for (const project of JSON.parse(projects)) {
const projectData = execSync(`pnpm nx show project ${project} --json`);
const path = JSON.parse(projectData).root;
Expand All @@ -14,7 +15,13 @@ for (const project of JSON.parse(projects)) {

try {
execSync(`pnpm tsc -p ${tsConfig}`, { stdio: 'inherit' });
} catch (error) {}
} catch (error) {
isFailed = true;
}
console.groupEnd();
}
}

if (isFailed) {
throw new Error('Type check has failed');
}
Loading