NEAR-DevHub / neardevhub-contract

DevHub Portal Product Contract (Hosted on NEAR Blockchain) – Includes other instances (e.g. Infrastructure, Events)
https://neardevhub.org
19 stars 15 forks source link

Migration to set all kanban and github addons of all communities to use camelCase type #84

Open ailisp opened 10 months ago

ailisp commented 10 months ago

Currently we have all community kanban and github addons look like this.

kanban:

{
  metadata: {
    id: uuid(),
    type: "kanban.post_board",
    title: "",
    description: "",
    ticket: {
      type: "kanban.post_ticket",
      features: {
        author: true,
        like_count: true,
        reply_count: false,
        sponsorship_request_indicator: false,
        requested_sponsorship_value: false,
        requested_sponsor: false,
        approved_sponsorship_value: true,
        sponsorship_supervisor: true,
        tags: true,
        type: true,
      },
    },
  },
  payload: {
    columns: {},
    tags: { excluded: [], required: [] },
  },
}

github:

{
  columns: {},
  dataTypesIncluded: { Issue: false, PullRequest: true },
  description: "",
  repoURL: "",
  ticketState: "all",
  title: "",
  metadata: {
    id: uuid(),
    type: "github.kanban_board",
    ticket: {
      type: "github.kanban_ticket",
      features: { id: true, author: true, labels: true, type: true },
    },
  },
}

We want to rename all types above to camel case, that is:

    type: "kanban.post_board", => "kanban.postBoard"
    type: "kanban.post_ticket", => "kanban.postTicket"
    type: "github.kanban_board", => "github.kanbanBoard"
    type: "github.kanban_ticket", => "github.kanbanTicket"

These can be update with set_community_addon in near-cli, but there are many communities to run with cli commands. A more efficient way would be writing a migration in this contract repo and batch update these addon type and metadata type.

cc @Megha-Dev-19