Skip to content

IMT

General

Merge Requests

  • SQDs should only be on one of the companion MRs

Sprint Planning

Typical Review Flow

  • start at current Dev Board to review status of columns
  • move to Planning Board to look for above the line issues
  • move to Support nub issues and filter with label="source:IMT Requests" and parent="WC v1 Initial Go-Live"
  • go through Planning Board triage
  • go through Print - All board in Tech Services project

Releases

  • can go out of order when releasing code to environments
    • staging to QA is fine, etc
    • issue is when you merge directly to an environment like QA, staging will then need updated
  • if a test job is failing and it can be guaranteed as a flaky issue, the successful pipeline merge check can just be disabled
  • the order of releases is so that production is always a release behind
  • release MRs SHOULD NEVER squash commits
    • if this happens a restart to releases should fix the commits

Fixing Release Conflicts

  1. Branch from the target branch and pull in the branch to be merged and then MR that to the target branch.
  2. Comment on the MR that it's being used in place of and release notes can be found at
  3. Close the release MR since it can't merge as-is

Users

  • changes to permission names are a code change that would happen within the permission's nub

Permissions

  • anyone with policy_system_internal will always have policy_system_access

Naming Variables

Variables should tell you exactly what it is for without having to even read the logic. Avoid naming them for what the usage is using them for. Think of this as being very literal.

Generalize when possible, avoid naming specifically towards a feature like oos unless you can say with certainty it is only for that feature.

Anti Pattern

While this is used as the cancel_date, it is not the cancel date, it is the time now.

py
cancel_date = datetime.now(timezone.utc).strftime('%Y-%m-%d')

Best Practice

py
now = datetime.now(timezone.utc).strftime('%Y-%m-%d')

Naming Methods

Methods should follow similar convention as variables. We should avoid naming methods, computeds, etc by a specific usage and name them for what they are literally doing.

Anti Pattern

While this is being used to hide the reapply card, it is hiding it because the policy does not have oos versions.

js
hideReapplyCard()

Best Practice

js
policyHasOOSVersions()

Tips

  • use clone over deepcopy when available
  • when adding new model fields consider if it should be added to the ignore fields
    • the question to ask is "would this be needed for configuration at this time?"
  • any data in the frontend should be camelCased, the serializer will handled converting to snake_case when an api call is made
  • each page load peforms actions, consider these when making changes that affect a page
  • use toolboxUtils.console.log over other logging like console.warn or console.error
  • don't default a value if not having the value may cause issues
  • think about the YAGNI principle
  • it's important to consider if something could be fixed via configuration instead of via code
    • things like behandle processes and tasks will be configurable per policy system so values can be set uniquely there

Custom Serializers

ModelWithExtensionSerializer

This serializer allows us to skip over mapping the existing extension object.

Anti Pattern

python
await this.updateVersion({
      processingStatus: 'rejected',
      extension: {
          ...this.policyVersion.extension,
          system_reject: true,
      },
  }, false);

Best Practice

python
await this.updateVersion({
      processingStatus: 'rejected',
      extension: {
          system_reject: true,
      },
  }, false);

Toolbox Utils

stripIds(obj = {}, whichKeys = ['id', 'type'])

Can be used to delete an object from a dataset by id or type.

Markdown Tips

For Resizing Images

md
![Run permissions audit job](images/run_permissions_audit.png){width=700px}

Debugging Tips

git bisect

  • a handy technique to help identify culprit commits for bugs or regressions
  • this can even be automated via tests to further speed up the process

QA/Prod data

  • automation idea for a shared s3 bucket
    • management command with pgdump to s3 bucket and that gets pulled
  • going to push QA to Prod one time initially
    • imt pip change
    • trove token is an issue
  • using clone command for QA to Prod
    • need to do a test w current work comp, will be wiped for release day
    • will want to make a QA backup before running this
      • currently they don't want us to have backups and we should have backups in the future
        • not good that we don't have a QA backup
        • staging does somewhat act as a backup
    • clone will or should help cleanup obsolete items
    • will want to consider local users table cloning
      • shouldn't have issues since AD holds the UUID for each users across all environments
        • this doesn't pertain to users created within an environment which is primarily system users
    • some debate between pgdump management command and just using clone
      • bit uncertain why we are just going for a clone
  • try our process in clone before trying in prod
  • we have a week of restore but we want backups
  • main idea is going to be have prod pull the data via sqs instead of qa pushing data