Skip to content

Conversation

@zimeg
Copy link
Member

@zimeg zimeg commented Mar 21, 2023

Type of change

  • New sample
  • New feature
  • Bug fix
  • Documentation

Summary

To showcase a new datastore operation, this PR replaces the datastore.put call in the advance_rotation function with datastore.update. With this call, only the fields passed into this function will be updated with the primary key channel, while those unspecified are not modified.

The versions of Deno modules were also bumped to support this new function.

Testing

To verify the changes of this PR manually, install this app to a workspace and create a rotation with more than one user.

Then create a trigger with the following definition to force a rotation, and trip this trigger:

import { Trigger } from "deno-slack-api/types.ts";
import AdvanceRotationWorkflow from "../workflows/advance_rotation.ts";

const advanceRotationTrigger: Trigger<
  typeof AdvanceRotationWorkflow.definition
> = {
  type: "shortcut",
  name: "Advance rotation",
  description: "Forcibly advance the rotation",
  workflow: "#/workflows/advance_rotation",
  inputs: {
    channel: {
      value: "{{data.channel_id}}",
    },
  },
};

export default advanceRotationTrigger;

Requirements

  • I’ve checked my submission against the Samples Checklist to ensure it complies with all standards
  • I have ensured the changes I am contributing align with existing patterns and have tested and linted my code
  • I've read and agree to the Code of Conduct

@zimeg
Copy link
Member Author

zimeg commented Mar 21, 2023

FYI: To appease the type checker, I had to merge the changes from #8 into this branch.

Copy link
Contributor

@hello-ashleyintech hello-ashleyintech left a comment

Choose a reason for hiding this comment

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

Tested this and it's looking great! 🎉 (Also thanks for including a link trigger to test the advancing of the rotations! 🙌)

A few thoughts before merging:

  • The base of this PR is in a strange state due to the deno-slack-sdk version bump down we had to do in this PR, with Fil’s PR (#8) bumping that version back up to 1.6.0, which will no longer be the latest version after Beta Release 28 is completed this week. I could see this causing some sort of merge conflict depending on when this is merged in, specifically with the deno-slack-sdk version being 1.6.1 in the pre-release branch. If this PR is merged before pre-release-0316 is, we’ll definitely want to rebase that branch against main to avoid any conflicts. If this PR is merged after pre-release-0316 is merged in, then we’ll need to rebase this branch to avoid conflicts.
  • On a somewhat related note, I also wanted to double check with @filmaj that the proposed changes in #8 were good to be incorporated into this PR and merged in. If it’s preferred to keep those changes separate, we can also merge that PR first and then rebase this on top. If we do end up merging Fil's PR into main, that’ll be another moving part that may require updating pre-release-0316 depending on merging timing, so that might be another thing to consider with regards to consolidating these changes or not.

Let me know if there are any questions with this!

@filmaj
Copy link
Contributor

filmaj commented Mar 22, 2023

#8 merged in first, or incorporated into this, both seem good. But definitely get the changes from #8 in! Those are key

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.

6 participants