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

Publish Bitbucket CI/CD Article #1357

Merged
merged 9 commits into from
May 6, 2022

Conversation

gwenwindflower
Copy link
Contributor

@gwenwindflower gwenwindflower commented Apr 19, 2022

Description & motivation

This PR adds a new article to the Developer Blog from @shippy covering specifically how to enable Slim CI/CD on Bitbucket, alongside the general principles for applying this method on any currently (offically) unsupported/unintegrated development platform (everything outside Github and GitLab)

This closes #1322

@netlify
Copy link

netlify bot commented Apr 19, 2022

Deploy Preview for docs-getdbt-com ready!

Name Link
🔨 Latest commit 9d42c70
🔍 Latest deploy log https://app.netlify.com/sites/docs-getdbt-com/deploys/62751a79b2d9b5000861cd46
😎 Deploy Preview https://deploy-preview-1357--docs-getdbt-com.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site settings.

@gwenwindflower gwenwindflower self-assigned this Apr 19, 2022
@gwenwindflower gwenwindflower added the developer blog This content fits on the developer blog. label Apr 19, 2022
Copy link
Contributor

@shippy shippy left a comment

Choose a reason for hiding this comment

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

The quotes are the only thing that would cause a problem for someone copy-pasting the code.


alter schema dbt_ci owner to role_dev;

create role dbt_bitbucket with login password ‘[password]’;
Copy link
Contributor

Choose a reason for hiding this comment

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

Bad single quotes


-- Grant all permissions required for the production role

create role dev_ci with login password ‘[password]’;
Copy link
Contributor

Choose a reason for hiding this comment

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

Bad single quotes


You’ll need at least your dbt adapter-specific package, ideally pinned to a version. Mine is just

`dbt-[adapter] ~= 1.0`.
Copy link
Contributor

Choose a reason for hiding this comment

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

Should this be a code block?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

ehhh yea, yea, for consistency, even though it's one line it's still an entire file and we should make it a block.


It’s important to remember that CI/CD is a convenience, not a panacea. You must still devise the model logic and determine the appropriate tests. Some things it can do, though: catch more mistakes early, make sure that the database always reflects the most up-to-date code, and decrease the friction in collaboration. By automating the steps that should *always* be taken, it frees you up to think about the unusual steps required (e.g., do your changes to [incremental models](https://docs.getdbt.com/docs/building-a-dbt-project/building-models/configuring-incremental-models) require an additional deployment with `--full-refresh`?) and reduces the amount of review that others’ actions necessitate.

Plus, it’s a good time, and it’s fun to watch the test lights turn green. Ding!
Copy link
Contributor

Choose a reason for hiding this comment

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

...I really can't think of another way to end this, but dear lord in heaven there must be a serious sentence somewhere out there, right? Alternately, I think this needs a gif to illustrate the "Ding!"

Copy link
Contributor

@shippy shippy Apr 19, 2022

Choose a reason for hiding this comment

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

Maybe this:

wild-child-yes.gif

Copy link
Contributor Author

Choose a reason for hiding this comment

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

hahahah YES there's no turning back now this is The One ✅ .

@gwenwindflower
Copy link
Contributor Author

also need to add an author page for you @shippy so we can add the frontmatter metadata -- if you want to either send me the stuff you want here or feel free to just pull this branch and add a commit! here's the existing ones for an example: https://github.com/dbt-labs/docs.getdbt.com/blob/current/website/blog/authors.yml

@gwenwindflower gwenwindflower removed the request for review from KiraFuruichi April 19, 2022 22:36
@shippy
Copy link
Contributor

shippy commented Apr 19, 2022

Right - something like this:

simon_podhajsky:
  name: Simon Podhajsky
  job_title: Data Lead
  organization: iLife Technologies
  description: >
    Simon Podhajsky is a lapsed neuroscientist turned full-stack data engineer 
    at iLife Technologies, a startup that seeks to digitize the life insurance 
    agency.
  image_url: /img/blog/authors/simon-podhajsky.png
  links:
    - url: https://www.linkedin.com/in/simonpodhajsky/
      icon: fa-linkedin
    - url: https://twitter.com/sim_pod
      icon: fa-twitter

I'll find a profile picture that fits and send it along.

@KiraFuruichi
Copy link
Contributor

also need to add an author page for you @shippy so we can add the frontmatter metadata -- if you want to either send me the stuff you want here or feel free to just pull this branch and add a commit! here's the existing ones for an example: https://github.com/dbt-labs/docs.getdbt.com/blob/current/website/blog/authors.yml

+1 to this and your author image! I believe you can also need to add a section to the beginning of the actual blog md where you have the title/author.etc. (example below). If you add this section, you can also remove the H1 # and text since the title tag will generate it for you (@gwenwindflower correct me if I'm wrong here)!

The other styling thing is adding a truncate somewhere in the beginning of your blog md file where you feel it's appropriate! Feel free to look at the other blog posts to see where they've implemented them.

image

@shippy
Copy link
Contributor

shippy commented Apr 19, 2022

also need to add an author page for you @shippy so we can add the frontmatter metadata -- if you want to either send me the stuff you want here or feel free to just pull this branch and add a commit! here's the existing ones for an example: https://github.com/dbt-labs/docs.getdbt.com/blob/current/website/blog/authors.yml

@gwenwindflower I've made all the required changes but can't push to this repository -- wanna add me as a collaborator, or should I fork and make a PR to the PR?

@gwenwindflower
Copy link
Contributor Author

unfortunately @shippy i have to ask you to fork and PR your changes to my branch 😓 we have a limited number of seats for permissions for write access

we're looking at some CMS options that might make this less of a pain in the ass -- with code it feels more understandable, but forking stuff to manage content definitely feels....extra...thanks for bearing with 🙏🏻

@shippy
Copy link
Contributor

shippy commented Apr 20, 2022

How lucky that I already have a fork for #1060 :) Will make the PR momentarily.

@gwenwindflower gwenwindflower marked this pull request as ready for review May 2, 2022 18:46
@gwenwindflower gwenwindflower requested review from a team, annafil and runleonarun as code owners May 2, 2022 18:46
@gwenwindflower
Copy link
Contributor Author

@johnblust this is ready to go whenever y'all are ready to publish 🙏🏻 -- feel free to merge away

@johnblust
Copy link
Contributor

@johnblust this is ready to go whenever y'all are ready to publish 🙏🏻 -- feel free to merge away

Thank you @gwenwindflower , this looks great! Thank you so much for the work you put into this ❤️ I'll need one of the reviewers to approve the PR before I am allowed to merge, though. @shippy an approved review from you might do the trick!

Copy link
Contributor

@shippy shippy left a comment

Choose a reason for hiding this comment

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

LGTM

@shippy
Copy link
Contributor

shippy commented May 2, 2022

@johnblust I submitted an approving review, but I think Github (correctly) blocks the merge because an authorized review by @runleonarun or @annafil is required.

@gwenwindflower
Copy link
Contributor Author

@johnblust you technically actually can give it an approved review yourself since you have write access -- it's not limited to the folks autorequested, just anybody internal who has write access (this is why @shippy can't give it the ✅) but if process wise you're avoiding approving PRs, which i get, we could get @KiraFuruichi to 👍🏻 this one and lauren's ?

@KiraFuruichi KiraFuruichi self-requested a review May 2, 2022 21:25
Copy link
Contributor

@KiraFuruichi KiraFuruichi left a comment

Choose a reason for hiding this comment

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

Sooo excited for this one!

@gwenwindflower
Copy link
Contributor Author

Screen Shot 2022-05-02 at 16 25 41

@johnblust if you ever want to review code that you haven't been requested on you can go to the Files changed tab and you'll see a button to add a review. You can give your opinion to anybody, who cares if they want it? You're John Blust!

@johnblust
Copy link
Contributor

Screen Shot 2022-05-02 at 16 25 41

@johnblust if you ever want to review code that you haven't been requested on you can go to the Files changed tab and you'll see a button to add a review. You can give your opinion to anybody, who cares if they want it? You're John Blust!

Learning something new everyday lol, thanks @gwenwindflower :)

@shippy
Copy link
Contributor

shippy commented May 4, 2022

So it seems like there might be three things that need to happen:

  1. Change the article date to sometime in May,
  2. Rebase off base branch / merge it into this one,
  3. Actually hit the Merge button while the date in (1) is still CURRENT_DATE and before anything else gets merged into current branch that would require re-doing (2).

@johnblust Is that something that you can do? Should I make another PR-to-this-PR?

@johnblust
Copy link
Contributor

@shippy Yep! I've got it handled.

Your article will be published this Friday, May 6th, on the Developer Blog sometime between 9am-10am ET. I can alert you via dbt Slack if you like! Then, on Monday, May 9th, we will share your article on our official LinkedIn and Twitter account at 8:30am ET if you would like to share/amplify with your own social pages. Also happy to alert you when the social push is live :)

Very excited to get this published for you!

@shippy
Copy link
Contributor

shippy commented May 4, 2022

@johnblust Thank you for taking care of it! No need for the separate alert, you're already doing plenty :)

@johnblust johnblust merged commit baba14b into current May 6, 2022
@johnblust johnblust deleted the gw/feature/sp-bitbucket-ci-cd-article branch May 6, 2022 13:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
developer blog This content fits on the developer blog.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Article on CI/CD with Bitbucket
4 participants