How I Contributed to OpenStack: A Skyline Console Bug Fix Retrospective
Contributing to open source is less about fixing a single line of code and more about pushing that change through the project’s own process. OpenStack in particular does not use the GitHub PR model. It uses a slightly unfamiliar trio: Launchpad (bug tracking) + Gerrit (code review) + Zuul (CI).
This post covers how I found and fixed a monitoring chart bug in Skyline Console, along with the OpenStack contribution workflow I went through along the way. I hope it can be a small map for anyone trying to make their first OpenStack contribution.
What I Fixed
Section titled “What I Fixed”Skyline is OpenStack’s next-generation dashboard (the successor to Horizon). Its Monitoring Center screen pulls metrics from Prometheus and draws graphs such as CPU/memory usage and per physical node IOPS and network traffic.
Symptom
Section titled “Symptom”- Launchpad bug: #2015991
- Reported environment: OpenStack Ussuri / Ubuntu 18.04
- Behavior: in the Monitoring Center, range query metrics were not displayed on screen at all
Only single (current) values showed up, while 13 kinds of range data with a time axis (usage trend graphs and so on) all came up blank. Since these are the graphs you look at most often on a dashboard, it was a fairly big bug in practice.
Root Cause
Section titled “Root Cause”The problem was in handleResponse(), the function that converts a Prometheus response into chart data.
Prometheus returns different response shapes depending on the query type.
- current (instant) query results contain
value(a single value). - range query results contain
values(an array of values).
The original code handled these two like this.
// src/components/PrometheusChart/utils/dataHandler.js (before)const values = result.values || [result.value] || [];It looks fine at a glance, but it broke in the case where a range response actually delivered its data in result.value as an array of arrays. Wrapping it once more with [result.value] distorted the data structure, and the chart ended up drawing nothing.
The Fix
Section titled “The Fix”The key was to check whether result.value is already an array of arrays (range), and if so use it as is, otherwise wrap it.
// src/components/PrometheusChart/utils/dataHandler.js (after)const values = result.values || result.value.some(Array.isArray) ? result.value : [result.value] || [];The change was +4 / -1, a tiny single-file patch. But for this kind of “data unwrap type check” bug, finding the cause is most of the work, and the fix itself takes only a few lines. It is also a good example that an open source contribution does not have to be a huge feature addition.
- Commit:
0b7d79f - Commit message:
Implements: fix bug, check type of prometheus query result data/Closes-Bug: 2015991
How I Contributed: The OpenStack Workflow
Section titled “How I Contributed: The OpenStack Workflow”This is the real point of the post. Process over code. OpenStack flows differently from GitHub, so this is where everyone stumbles at first.
The overall flow I followed looks like this.
Launchpad (confirm the bug) -> git-review to upload the patch to Gerrit -> Zuul CI (check -> gate) -> core reviewer Code-Review +2 / Workflow +1 -> MergeLaunchpad: Grabbing the Bug
Section titled “Launchpad: Grabbing the Bug”OpenStack’s issue tracker is not GitHub Issues but Launchpad. If you write Closes-Bug: <number> in the commit message, the bug is automatically linked and closed on merge. So nailing down the target bug number (here, 2015991) before you start is the first button to fasten.
Gerrit: Patch Sets Instead of PRs
Section titled “Gerrit: Patch Sets Instead of PRs”OpenStack does not open PRs. Instead, you push a commit to Gerrit with the git review command, and that single commit becomes a review unit (patch set).
# Rough flowgit clone https://opendev.org/openstack/skyline-consolecd skyline-consolegit checkout -b bug/2015991
# ... edit code ...
git commit # commit message includes Closes-Bug and Change-Idgit review # upload to GerritWhat matters here is the Change-Id at the bottom of the commit message (mine was I77cedea...). Thanks to this ID, even if you fix the code mid-review and re-upload, it does not become a “new PR” but accumulates as the next patch set of the same review. It is similar to GitHub’s force-push concept, but much more explicit.
- My review: openstack/skyline-console +921355
- Patch Set 1 uploaded: 2024-06-05, topic
bug/2015991
Zuul: check and gate, and Tripping Once at the Gate
Section titled “Zuul: check and gate, and Tripping Once at the Gate”Once you push to Gerrit, OpenStack’s CI system Zuul runs automatically. There are two main stages.
- check: the first round of verification that runs right after you upload
- gate: the final verification that runs just before the actual merge, after review approval
Honestly, this part is what I remember most. check passed, but the e2e-compute test at the gate stage FAILED (Verified -2) and blocked the merge. It was an integration test that seemed unrelated to my patch, but if the gate is not green, there is no merge.
Review: The Core Reviewer’s +2
Section titled “Review: The Core Reviewer’s +2”In OpenStack, merge authority belongs to the core reviewers. The scoring system goes like this.
- Code-Review:
-2 to +2(a core’s+2is effectively approval) - Workflow:
+1must be attached to enter the gate (the switch that puts it into the merge queue) - Verified: the score Zuul assigns (
+2means CI passed)
A summary of my review journey:
- Uploaded Patch Set 1, assigned reviewers (zhangke, Gökhan, Boxiang Zhu, etc.)
- Gave myself a Code-Review +1, then withdrew it while tidying up reviewers
- Zuul check passed, then a test FAILED at the gate (Verified -2), the low point
- Addressed reviewer comments, recheck, and check passed again
- Code-Review +2, Workflow +1, re-entered the gate, Zuul Verified +2
- MERGED on 2024-06-07 (about two days from upload)
Retrospective: Small Patch, Big Lessons
Section titled “Retrospective: Small Patch, Big Lessons”Looking back, the actual code change was a single branching fix. And yet this contribution stuck with me, because I walked through OpenStack’s way of collaborating from start to finish.
- The skill of reproducing a bug and narrowing down the cause. Reaching the root cause, a difference in Prometheus response structure, was 80% of the work.
- The patience to follow the project’s rules. If you are used to GitHub PRs, Gerrit and Zuul feel unfamiliar and gate failures are frustrating. But that process is what sustains the quality of large open source.
- It is fine to start small. A one-line bug fix is a legitimate contribution. For a first contribution, a small bug like this is actually the best starting point.
If you are thinking about your first OpenStack contribution, do not go looking for a grand feature. Pick one reproducible small bug on Launchpad and take a full lap through this flow. Once the workflow is in your muscle memory, the next contribution becomes much lighter.
References
Section titled “References”- Launchpad Bug: #2015991 (监控中心 Prometheus 范围查询 metrics not displayed)
- Gerrit Review: openstack/skyline-console +921355
- Merged Commit:
0b7d79f