Skip to content

Commit

Permalink
synchronize hub script is moved to new windmill cli
Browse files Browse the repository at this point in the history
  • Loading branch information
rubenfiszel committed Sep 7, 2024
1 parent 9f6e945 commit 6f0af6b
Show file tree
Hide file tree
Showing 9 changed files with 34 additions and 39 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
-- Add down migration script here
11 changes: 11 additions & 0 deletions backend/migrations/20240907150910_migrate_to_new_cli.up.sql

Large diffs are not rendered by default.

4 changes: 4 additions & 0 deletions backend/windmill-worker/loader.bun.js
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,11 @@ const p = {
const filter = new RegExp(
`^(?!\\.\/main\\.ts)(?!${cdir}\/main\\.ts)(?!(?:/private)?${cdirNoPrivate}\/wrapper\\.mjs).*\\.ts$`
);
let cdirNodeModules = `${cdir}/node_modules/`;
build.onResolve({ filter }, (args) => {
if (args.importer?.startsWith(cdirNodeModules)) {
return undefined;
}
const file_path =
args.importer == "./main.ts" || args.importer == resolve("./main.ts")
? current_path
Expand Down
1 change: 0 additions & 1 deletion cli/deps.ts
Original file line number Diff line number Diff line change
Expand Up @@ -38,5 +38,4 @@ export * as http from "node:http";
export { WebSocketServer, WebSocket } from "npm:ws";

export * as open from "npm:open";
export { default as gitignore_parser } from "npm:gitignore-parser";
export * as esMain from "npm:es-main";
32 changes: 5 additions & 27 deletions cli/sync.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@ import {
yamlParse,
ScheduleService,
SEP,
gitignore_parser,
UserService,
GroupService,
} from "./deps.ts";
Expand Down Expand Up @@ -817,41 +816,20 @@ export async function ignoreF(wmillconf: {
},
};
}
let ign:
| {
denies(file: string): boolean;
}
| undefined = undefined;

try {
const ignoreContent = await Deno.readTextFile(".wmillignore");
const condensed = ignoreContent
.split("\n")
.filter((l) => l != "" && !l.startsWith("#"))
.join(", ");
log.info(
colors.gray(
`(Deprecated, use wmill.yaml/includes instead) Using .wmillignore file (${condensed})`
)
);
ign = gitignore_parser.compile(ignoreContent);
} catch {}

if (ign && whitelist) {
log.error(
"Cannot have both .wmillignore and wmill.yaml/includes or excludes, ignoring .wmillignore"
);
ign = undefined;
await Deno.stat(".wmillignore");
throw Error(".wmillignore is not supported anymore, switch to wmill.yaml");
} catch {
//expected
}

// new Gitignore.default({ initialRules: ignoreContent.split("\n")}).ignoreContent).compile();
return (p: string, isDirectory: boolean) => {
return (
!isWhitelisted(p) &&
(isNotWmillFile(p, isDirectory) ||
(!isDirectory &&
((whitelist != undefined && !whitelist.approve(p)) ||
(ign != undefined && ign.denies(p)))))
(!isDirectory && whitelist != undefined && !whitelist.approve(p)))
);
};
}
Expand Down
8 changes: 4 additions & 4 deletions frontend/src/lib/components/SavedInputs.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -223,7 +223,7 @@
<div class="w-full flex flex-col gap-1 h-full overflow-y-auto p">
{#if savedInputs === undefined}
<Skeleton layout={[[8]]} />
{:else if savedInputs.length > 0}
{:else if savedInputs?.length > 0}
{#each savedInputs as i}
<button
class={classNames(
Expand Down Expand Up @@ -324,7 +324,7 @@
<div class="w-full flex flex-col gap-1 p-0 h-full overflow-y-auto">
{#if loading && (jobs == undefined || jobs?.length == 0)}
<div class="text-left text-tertiary text-xs">Loading current runs...</div>
{:else if jobs.length > 0}
{:else if jobs?.length > 0}
{#each jobs as i (i.id)}
<button
class={classNames(
Expand Down Expand Up @@ -379,7 +379,7 @@
</div>
</button>
{/each}
{#if jobs.length == 5}
{#if jobs?.length == 5}
<div class="text-left text-tertiary text-xs"
>... there may be more runs not displayed here as the limit is 5</div
>
Expand All @@ -392,7 +392,7 @@
<div class="w-full flex flex-col gap-1 p-0 h-full overflow-y-auto">
{#if previousInputs === undefined}
<Skeleton layout={[[8]]} />
{:else if previousInputs.length > 0}
{:else if previousInputs?.length > 0}
{#each previousInputs as i (i.id)}
<button
class={classNames(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,7 @@
import GfmMarkdown from '$lib/components/GfmMarkdown.svelte'
import EmailTriggerPanel from '$lib/components/details/EmailTriggerPanel.svelte'
import Star from '$lib/components/Star.svelte'
import LogViewer from '$lib/components/LogViewer.svelte'
let script: Script | undefined
let topHash: string | undefined
Expand Down Expand Up @@ -578,15 +579,16 @@
{#if script.lock_error_logs || topHash || script.archived || script.deleted}
<div class="flex flex-col gap-2 my-2">
{#if script.lock_error_logs}
<div class="bg-red-100 border-l-4 border-red-500 text-red-700 p-4" role="alert">
<div
class="bg-red-100 dark:bg-red-700 border-l-4 border-red-500 p-4"
role="alert"
>
<p class="font-bold">Error deploying this script</p>
<p>
This script has not been deployed successfully because of the following
errors:
</p>
<pre class="w-full text-xs mt-2 whitespace-pre-wrap"
>{script.lock_error_logs}</pre
>
<LogViewer content={script.lock_error_logs} isLoading={false} tag={undefined} />
</div>
{/if}
{#if topHash}
Expand Down
2 changes: 1 addition & 1 deletion frontend/static/tailwind_full.css

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions frontend/tailwind.config.cjs
Original file line number Diff line number Diff line change
Expand Up @@ -717,10 +717,10 @@ const config = {
}
},
input: {
backgroundColor: 'rgb(var(--color-surface-secondary)) !important'
backgroundColor: 'rgb(var(--color-surface-secondary) / 30%) !important'
},
textarea: {
backgroundColor: 'rgb(var(--color-surface-secondary)) !important'
backgroundColor: 'rgb(var(--color-surface-secondary) / 30%) !important'
}
})
addComponents({
Expand Down

0 comments on commit 6f0af6b

Please sign in to comment.