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

Feat: add cronjob update #465

Merged
merged 30 commits into from
Sep 5, 2024
Merged

Feat: add cronjob update #465

merged 30 commits into from
Sep 5, 2024

Conversation

niristius
Copy link
Contributor

No description provided.

@niristius niristius changed the title Draft: Feat: add cronjob update Feat: add cronjob update Aug 1, 2024
@niristius

This comment was marked as outdated.

@niristius niristius marked this pull request as ready for review August 27, 2024 14:14
README.md Outdated Show resolved Hide resolved
README.md Outdated Show resolved Hide resolved
src/commands/cronjob/update.tsx Outdated Show resolved Hide resolved
…reter properly and handle empty changes more politely
src/commands/cronjob/create.tsx Outdated Show resolved Hide resolved
src/commands/cronjob/create.tsx Outdated Show resolved Hide resolved
src/commands/cronjob/create.tsx Outdated Show resolved Hide resolved
src/commands/cronjob/update.tsx Show resolved Hide resolved
src/lib/resources/cronjob/destination.ts Outdated Show resolved Hide resolved
src/lib/resources/cronjob/timeout.ts Outdated Show resolved Hide resolved
src/commands/cronjob/update.tsx Outdated Show resolved Hide resolved
src/commands/cronjob/create.tsx Outdated Show resolved Hide resolved
niristius and others added 3 commits September 4, 2024 10:17
Co-authored-by: Martin Helmich <m.helmich@mittwald.de>
…ture/cronjob-update

# Conflicts:
#	src/commands/cronjob/update.tsx
Copy link
Contributor Author

@niristius niristius left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

short inquiry

src/commands/cronjob/create.tsx Outdated Show resolved Hide resolved
src/commands/cronjob/create.tsx Outdated Show resolved Hide resolved
src/commands/cronjob/update.tsx Outdated Show resolved Hide resolved
Copy link
Contributor Author

@niristius niristius left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

final touches

const cronjobCreationData: CronjobCreationData = {
appId: appInstallationId,
active: !disable,
description,
interval,
email,
destination,
timeout: timeout.seconds,
};

const { id: cronjobId } = await p.runStep("creating cron job", async () => {
const r = await this.apiClient.cronjob.createCronjob({
projectId,
data: cronjobCreationData,
data: {
appId: appInstallationId,
active: !disable,
description,
interval,
email,
destination: buildCronjobDestination(url, command, interpreter),
timeout: timeout.seconds,
},
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

For some reason I was under the impression that if a key has an undefined value, currently set values for conjobs (or whichever entity is being updated) will be overwritten, I played around for a bit and it seems to not be the case wich makes this approach the most concise.

src/commands/cronjob/update.tsx Outdated Show resolved Hide resolved
@martin-helmich martin-helmich merged commit 35e6efa into master Sep 5, 2024
8 checks passed
@martin-helmich martin-helmich deleted the feature/cronjob-update branch September 5, 2024 09:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants