<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: Ashley Pean</title>
    <description>The latest articles on DEV Community by Ashley Pean (@ashleypean).</description>
    <link>https://dev.to/ashleypean</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F490719%2F6b3db89d-dd77-4484-a558-72013519755f.png</url>
      <title>DEV Community: Ashley Pean</title>
      <link>https://dev.to/ashleypean</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/ashleypean"/>
    <language>en</language>
    <item>
      <title>How to Get All Issues Linked to a Pull Request</title>
      <dc:creator>Ashley Pean</dc:creator>
      <pubDate>Sun, 31 Jul 2022 04:01:37 +0000</pubDate>
      <link>https://dev.to/ashleypean/how-to-get-all-issues-linked-to-a-pull-request-c8p</link>
      <guid>https://dev.to/ashleypean/how-to-get-all-issues-linked-to-a-pull-request-c8p</guid>
      <description>&lt;h2&gt;
  
  
  Intro
&lt;/h2&gt;

&lt;p&gt;The Github API provides a lot of fluidity in being able to access and mutate data within git programmatically. Github provides developers with both a traditional &lt;a href="https://octokit.github.io/rest.js/v18/"&gt;REST API&lt;/a&gt; and a more modern &lt;a href="https://github.com/octokit/graphql.js"&gt;GraphQL API&lt;/a&gt; to interact with. However because of the increased flexibility of GraphQL APIs, there is some functionality that is available in GraphQL that is not available in REST. &lt;/p&gt;

&lt;p&gt;So today, we'll explore how to use Github's GraphQL API to find all issues linked to a pull request. &lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Note:&lt;/strong&gt; This tutorial will be using node. Scroll to bottom for a TLDR;&lt;/p&gt;

&lt;h2&gt;
  
  
  Prerequisites
&lt;/h2&gt;

&lt;ol&gt;
&lt;li&gt;Have a personal access token created in Github. This a personal oAuth token that Github uses to verify what user you are and if you have permissions to access the data that you're requesting. If you do not have one, you can create one using the documentation &lt;a href="https://docs.github.com/en/authentication/keeping-your-account-and-data-secure/creating-a-personal-access-token"&gt;here&lt;/a&gt;. Make sure to create the token with the following permissions: &lt;code&gt;repo&lt;/code&gt;, &lt;code&gt;workflow&lt;/code&gt;, &lt;code&gt;user&lt;/code&gt;
&lt;/li&gt;
&lt;li&gt;Have a basic understanding of how GraphQL queries work. We'll go over the structure of the specific query needed in this article, but it helps to have that knowledge upfront &lt;/li&gt;
&lt;/ol&gt;

&lt;h2&gt;
  
  
  The Query
&lt;/h2&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;query getLinkedIssues(
  $repository: String!,
  $organizationOrOwner: String!,
  $prNumber: Int!,
  $maxIssues: Int!,
) {
  repository(number: $prNumber) {
    closingIssuesReference(first: $maxIssues) {
      nodes {
        number
        body
        title
      }
    }
  }
}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;A breakdown of the query&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;query getLinkedIssues( 
  /*
    These are the params (or data points) needed to run the query
    Params with a bang operator (!) are required

    It includes: 
     - repository: name of the repository you're accessing
     - owner: name of the owner of the repository
     - prNumber: the number of the pull request who's issues you need 
     - maxIssues: the maximum number of issues that you would like returned
  */
  $repository: String!,
  $owner: String!,
  $prNumber: Int!,
  $maxIssues: Int!,
) {
  repository(number: $prNumber) {

    // All issues referenced in the PR with a closing prefix
    // Examples here: https://docs.github.com/en/issues/tracking-your-work-with-issues/linking-a-pull-request-to-an-issue
    closingIssuesReference(first: $maxIssues) {

      // Nodes represent the individual issues 
      nodes {

        // The data we want returned for each issue
        // Check out the Github GraphQL Explorer for a full list
        // https://docs.github.com/en/graphql/overview/explorer
        number
        body
        title
      }
    }
  }
}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h1&gt;
  
  
  Making the Request
&lt;/h1&gt;

&lt;p&gt;There are &lt;a href="https://docs.github.com/en/rest/overview/libraries"&gt;a few libraries&lt;/a&gt; you can use to interact with the Github API client that give you the ability to interact with Github's GraphQL client. For the purpose of this tutorial we'll provide one example using octokit's node-based client. &lt;/p&gt;

&lt;p&gt;If you'd like more control on the type of data you return back, feel free to check out &lt;a href="https://docs.github.com/en/graphql/overview/explorer"&gt;Github's GraphQL Explorer&lt;/a&gt;. It's a great playground that allows you to practice (and execute) queries so you can get a feel of the full API.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;
&lt;span class="k"&gt;import&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="nx"&gt;graphql&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt; &lt;span class="k"&gt;from&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;@octokit/graphql&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;

&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;linkedIssuesQuery&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="s2"&gt;`
query getLinkedIssues(
  $repository: String!,
  $owner: String!,
  $prNumber: Int!,
  $maxIssues: Int!,
) {
  repository(number: $prNumber) {
    closingIssuesReference(first: $maxIssues) {
      nodes {
        number
        body
        title
      }
    }
  }
}
`&lt;/span&gt;

&lt;span class="cm"&gt;/* NOTE: 
This function needs your personal access token
in order to authorize and execute the query. 

DO NOT COPY AND PASTE YOUR TOKEN DIRECTLY. 

Instead, I recommend keeping the token in a 
.env file and not committing it to your source code
*/&lt;/span&gt;

&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;getIssueData&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="k"&gt;async&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;myToken&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;issueData&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="k"&gt;await&lt;/span&gt; &lt;span class="nx"&gt;graphql&lt;/span&gt;&lt;span class="p"&gt;({&lt;/span&gt;
    &lt;span class="na"&gt;query&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nx"&gt;linkedIssuesQuery&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
    &lt;span class="na"&gt;repository&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="nx"&gt;INSERT_REPO_NAME_HERE&lt;/span&gt;&lt;span class="p"&gt;],&lt;/span&gt;
    &lt;span class="na"&gt;owner&lt;/span&gt;&lt;span class="p"&gt;:[&lt;/span&gt;&lt;span class="nx"&gt;INSERT_OWNER_HERE&lt;/span&gt;&lt;span class="p"&gt;],&lt;/span&gt;
    &lt;span class="na"&gt;prNumber&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="nx"&gt;INSERT_PR_NUMBER_HERE&lt;/span&gt;&lt;span class="p"&gt;],&lt;/span&gt;
    &lt;span class="na"&gt;maxIssues&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="nx"&gt;INSERT_MAX_ISSUES_HERE&lt;/span&gt;&lt;span class="p"&gt;],&lt;/span&gt;
    &lt;span class="na"&gt;headers&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
      &lt;span class="c1"&gt;// Include a space after the word bearer&lt;/span&gt;
      &lt;span class="na"&gt;authorization&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;bearer &lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="nx"&gt;myToken&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
    &lt;span class="p"&gt;},&lt;/span&gt;
  &lt;span class="p"&gt;});&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  TLDR;
&lt;/h2&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;query getLinkedIssues(
  $repository: String!,
  $organizationOrOwner: String!,
  $prNumber: Int!,
  $maxIssues: Int!,
) {
  repository(number: $prNumber) {
    closingIssuesReference(first: $maxIssues) {
      nodes {
        number
        body
        title
      }
    }
  }
}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



</description>
      <category>github</category>
      <category>graphql</category>
    </item>
    <item>
      <title>How to Leverage Twitter as a Software Engineer</title>
      <dc:creator>Ashley Pean</dc:creator>
      <pubDate>Sat, 28 May 2022 04:09:01 +0000</pubDate>
      <link>https://dev.to/ashleypean/how-to-leverage-twitter-as-a-software-engineer-22j7</link>
      <guid>https://dev.to/ashleypean/how-to-leverage-twitter-as-a-software-engineer-22j7</guid>
      <description>&lt;p&gt;Joining the software engineering space as a new developer or keeping up with changes to the community while maintaining full-time responsibilities can be a really daunting task. Luckily, there are some very prominent platforms that make connecting to other developers easy. Today I want to talk about how you can level up your engineering career using Twitter.  &lt;/p&gt;

&lt;p&gt;There are 4 main ways I think using Twitter can help you grow as a technologist: &lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Personal Growth&lt;/li&gt;
&lt;li&gt;Networking&lt;/li&gt;
&lt;li&gt;Learning&lt;/li&gt;
&lt;li&gt;Fun!&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;So let's get into it!&lt;/p&gt;

&lt;p&gt;P.S. This is going to be a pretty long post, so scroll down for a nice TLDR;&lt;/p&gt;

&lt;h2&gt;
  
  
  Personal Growth
&lt;/h2&gt;

&lt;p&gt;Since Twitter is basically a personal diary, it just makes sense to track your personal growth as a developer on the platform. It's a great way to be able to look back on how you've grown both as a person and an engineer and to see all the milestones and achievements you've crossed. &lt;/p&gt;

&lt;p&gt;And I know that sharing your personal thoughts, goals, successes, and failures in a public space can be pretty scary. And it can feel pointless to shout into the void to your 10 followers (8 of which are bots). But on the days where you  want to give up and just throw your computer into the sea, being able to look back and see how far you've come and to realize that you are exactly where you wished to be in the past will give you the strength to keep going.   &lt;/p&gt;

&lt;h2&gt;
  
  
  Learning
&lt;/h2&gt;

&lt;p&gt;One of my favorite parts of using Twitter is that every single user now has the ability to ingest an almost infinite amount of educational content passively. &lt;/p&gt;

&lt;p&gt;No matter how obscure of a field you're interested in, there are always experts willing to provide knowledge that took them years, or even decades to accumulate. And you can gather all of that cumulative knowledge just at the flick of your thumb. Plus it's a great way stay in the loop with all of the new and upcoming changes in the tech industry!&lt;/p&gt;

&lt;p&gt;A good technique for finding valuable accounts to follow is to use &lt;a href="https://hcsmmonitor.com/2021/03/11/thursdaytip-how-to-follow-topics-on-twitter/"&gt;Twitter's Topic feature&lt;/a&gt;. By following certain topics, Twitter's algorithm will add tweets to your timeline from users who are prominent in the topic that you're interested in and expose you to some new people. By using the feature, I've now been exposed to so many big names in the industry. From CTO's, VP's, and senior engineers at almost every major tech company, to huge names in open-source work, and even to people who are just passionate about the work that they do and making the tech space a more friendly and open one.&lt;/p&gt;

&lt;p&gt;Another similar tool is &lt;a href="https://help.twitter.com/en/using-twitter/twitter-lists"&gt;Twitter's list feature&lt;/a&gt;. A lot of people in the tech industry have taken the time to curate lists of people to follow in every industry in the tech space (cybersecurity, IT, blockchain, networking, etc.). And by following the lists that others have created, you can get direct access to the content from people on any list you decide to follow.&lt;/p&gt;

&lt;h2&gt;
  
  
  Networking
&lt;/h2&gt;

&lt;p&gt;Another great advantage of using Twitter as an engineer (and probably the most valuable) is how &lt;em&gt;easy&lt;/em&gt; it makes it to network with others. Whether you have 2 or 2000 followers, you still have the same ability as any other person to show off your skills and knowledge. And having a public, social repository of all your work can be very enticing to potential employers and non-technical recruiters. &lt;/p&gt;

&lt;h3&gt;
  
  
  Hiring Resources
&lt;/h3&gt;

&lt;p&gt;There is a growing community of devs/ex-devs on Twitter who have created wonderful hiring resources on the platform. This is absolutely not an exhaustive list, but some notable ones are:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;&lt;a href="https://twitter.com/TechIsHiring"&gt;#TechIsHiring&lt;/a&gt;, a hashtag and account created by &lt;a href="https://twitter.com/Chad_R_Stewart"&gt;@Chad_R_Stewart&lt;/a&gt;&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;a href="https://twitter.com/DevStartupJobs"&gt;@DevStartupJobs&lt;/a&gt;, an account and website that posts jobs for small, midsized, and large tech startups&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;a href="https://twitter.com/DiversifyTechCo"&gt;@DiversifyTechCo&lt;/a&gt;, an account and site that posts jobs by companies that are specifically looking to hire technologists from traditionally marginalized communities&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;a href="https://twitter.com/btpipeline"&gt;@BTPipeline&lt;/a&gt;, a jobs board created by &lt;a href="https://twitter.com/ParissAthena"&gt;@ParissAthena&lt;/a&gt; - the creator of &lt;a href="https://twitter.com/search?q=%23BlackTechTwitter&amp;amp;src=typeahead_click"&gt;#BlackTechTwitter&lt;/a&gt;&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;And there are hiring boards available for just about every facet of technology out there (crypto, college grads, self-taught/bootcamp grads, non-technical tech roles, etc. )&lt;/p&gt;

&lt;h3&gt;
  
  
  How to Find Hiring Managers
&lt;/h3&gt;

&lt;p&gt;And while all of these hiring resources are great, they can't  catch every cool opportunity that's out there - only the ones that are willing to pay to get advertised. So another great tool I've used in the past is Twitter's &lt;em&gt;Following&lt;/em&gt; feature. &lt;/p&gt;

&lt;p&gt;Say for example that I'm super into Airbnb and it's my personal dream to work for that company. If I go to &lt;a href="https://twitter.com/airbnb"&gt;Airbnb's Twitter account&lt;/a&gt; - or their &lt;a href="https://twitter.com/AirbnbEng"&gt;engineering account&lt;/a&gt;, I can then go through the list of &lt;a href="https://twitter.com/AirbnbEng/following"&gt;who they're following&lt;/a&gt;. And a majority of the names on that list will be: &lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;People who work(ed) for the company,&lt;/li&gt;
&lt;li&gt;Prominent people who work in the same or a similar industry, or&lt;/li&gt;
&lt;li&gt;Open source tooling/software that the company works with&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;Now before I say anything else I want to give a huge disclaimer. &lt;strong&gt;&lt;em&gt;PLEASE DO NOT BE A CREEP OR HARASS ANYBODY.&lt;/em&gt;&lt;/strong&gt; While you can find prominent people in the industry , at the end of the day, they are still people - not magical beings who can give you a free ride into your dream job or salary. Please be &lt;strong&gt;&lt;em&gt;respectful&lt;/em&gt;&lt;/strong&gt; and &lt;strong&gt;&lt;em&gt;courteous&lt;/em&gt;&lt;/strong&gt; at all times and remember that there is another human being on the other side of the screen.&lt;/p&gt;

&lt;p&gt;That being said, if you are able to connect with people that are already in the industries you want to be in or just passively follow them along their journeys, they'll oftentimes post valuable insights about the work that they're doing, the culture of engineering for their specific team(s), and any jobs that are available on their team(s). These are also likely the people who will be conducting interviews, will be on hiring panels, or will be direct hiring managers. And you'll probably have a better chance reaching out to them directly than you would sending out a cold application through the jobs portal. &lt;/p&gt;

&lt;h2&gt;
  
  
  Fun!
&lt;/h2&gt;

&lt;p&gt;And last, but definitely not least, social media is fun - or it can be. If you're careful to engage with others respectfully and you curate your feed to your specific tastes, you can find some really great people with great insights, some fantastic memes/TikTok's, some really enlightening conversations, and some international friends! &lt;/p&gt;

&lt;p&gt;Yes, you may have to listen to grown adults argue about whether or not HTML is a programming language for the 100th time, but overall the Tech Twitter experience is a pretty great one!&lt;/p&gt;

&lt;p&gt;And if you liked this post or learned anything, feel free to visit my feed and follow &lt;a href="https://twitter.com/ashleypeandev"&gt;@ashleypeandev&lt;/a&gt;, hopefully I'll get to posting more engaging content soon.&lt;/p&gt;

&lt;p&gt;TLDR;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;It's a great resource to track your personal growth.&lt;/li&gt;
&lt;li&gt;There's almost unlimited learning content.&lt;/li&gt;
&lt;li&gt;There are tons of job boards/and recruiters on the hunt for people to fill roles that you can reach out to.&lt;/li&gt;
&lt;li&gt;It's a great way to keep up with changes/people in the industry.&lt;/li&gt;
&lt;li&gt;It's a great tool to reach out to senior technologists/domain-specific experts and to get direct access to people involved in the hiring process.&lt;/li&gt;
&lt;li&gt;It's a fun time!&lt;/li&gt;
&lt;/ul&gt;

</description>
      <category>twitter</category>
      <category>career</category>
    </item>
  </channel>
</rss>
