Skip to content

Commit

Permalink
add picture to blog
Browse files Browse the repository at this point in the history
  • Loading branch information
cjtim committed Nov 2, 2023
1 parent 14c2c34 commit 50dbdf3
Show file tree
Hide file tree
Showing 2 changed files with 59 additions and 15 deletions.
60 changes: 45 additions & 15 deletions src/content/projects/1-renovatebot.md
Original file line number Diff line number Diff line change
@@ -1,28 +1,58 @@
---
title: 'Renovate Bot Open-source contribution'
pubDate: 2023-11-01
description: 'This is the first post of my new Astro blog.'
author: 'Tim Jinna'
title: "Renovate Bot: Open-source Contributions"
pubDate: 2022-11-01
description: "My story of making a contribution to Renovatebot"
author: "Tim Jinna"
image:
url: '/assets/projects/1/image.jpg'
alt: 'Renovatebot logo'
tags: ["astro", "blogging", "learning in public"]
url: "/assets/projects/1/image.jpg"
alt: "Renovatebot logo"
tags:
[
"open-source",
"renovatebot",
"Github",
"learning in public",
]
---
# Renovate bot open-source contribution!

# My Renovate Bot Open-source Contribution Adventure!

<!-- ![Pic](https://docs.astro.build/assets/full-logo-light.png) -->

**Published** on: 2023-11-01

Welcome to my _new blog_ about learning Astro! Here, I will share my learning journey as I build a new website.
**All My Pull Request**: [Check it out here](https://github.com/renovatebot/renovate/pulls?q=is%3Apr+author%3Acjtim+)

## TL;DR

In a nutshell, I managed to enhance Renovatebot's syntax parser within the Scala and Kotlin modules.

## The Story Unfolds

It all started back in July 2022 when I first came across Renovatebot. The goal was to enhance the developer experience within our company. After diving into the documentation and conducting thorough tests, I stumbled upon an issue with parsing Scala repositories. Scala allows variable lookup from inside a package definition, which can be seen in an example from IntelliJ [here](https://github.com/JetBrains/intellij-scala/blob/76efc6cfa54909926542d0138492d52a22aa65e3/project/dependencies.scala#L4).

I tried my hand at configuring it for a while using the [regex Manager](https://docs.renovatebot.com/modules/manager/regex/), but the results weren't as impressive as I'd hoped. So, I made a bold decision – to do something I had never done before: clone the repository and rewrite the parser manager. To be honest, the code was quite a challenge, and testing it required writing some additional scripts.

## The Technical Side

The solution I came up with was a new function I named `extractAllPackageFiles`. In the previous version, the Scala manager processed one `.scala` file at a time using `extractPackageFile` function, which had its limitations when it came to looking up variables in other files.

With the new function, I managed to:

## What I've accomplished
1. Iterate through all Scala files.
2. Store variables inside a Hashmap.
3. Populate the dependencies object.

1. **Installing Astro**: First, I created a new Astro project and set up my online accounts.
This enhancement allowed the Renovatebot Scala manager to read variables from other files, making it more powerful and versatile.

2. **Making Pages**: I then learned how to make pages by creating new `.astro` files and placing them in the `src/pages/` folder.
## My Contribution Highlights

3. **Making Blog Posts**: This is my first blog post! I now have Astro pages and Markdown posts!
Here are the Pull Requests where you can see the improvements I made:

## What's next
1. [Fix(manager/sbt): Allow adding Compiler Plugins #17006](https://github.com/renovatebot/renovate/pull/17006)
2. [Fix(manager/sbt): Allow star comments #17005](https://github.com/renovatebot/renovate/pull/17005)
3. [Fix(managers/gradle): Allow dot annotation in version.ref #21820](https://github.com/renovatebot/renovate/pull/21820)
4. [Fix(managers/sbt): SBT Multiple Variable File Lookup #21622](https://github.com/renovatebot/renovate/pull/21622)
5. [Chore(managers/sbt): Remove Unused Types #21570](https://github.com/renovatebot/renovate/pull/21570)

I will finish the Astro tutorial, and then keep adding more posts. Watch this space for more to come.
These contributions were a significant step in improving Renovatebot and its capabilities. I'm excited to continue my journey in the world of open-source contributions, and I hope this story inspires others to step out of their comfort zones and make a difference in the open-source community.
14 changes: 14 additions & 0 deletions src/pages/projects/[...slug].astro
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,20 @@ const { Content } = await entry.render()
class="w-full bg-gray-100 text-black"
>
<div class="h-4"></div>
<div
class="relative z-0 mx-auto aspect-video max-w-screen-md overflow-hidden lg:rounded-lg"
>
{
entry.data.image?.url && (
<img
src={entry.data.image?.url}
alt="Thumbnail"
loading={"lazy"}
class="h-full w-full rounded-2xl object-cover"
/>
)
}
</div>
<article
class="mx-auto max-w-screen-md"
>
Expand Down

1 comment on commit 50dbdf3

@vercel
Copy link

@vercel vercel bot commented on 50dbdf3 Nov 2, 2023

Choose a reason for hiding this comment

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

Please sign in to comment.