Unit 3
Unit 3
● Open Source Software (OSS) refers to software that is freely available for modification and
distribution.
● Platforms to discover relevant open-source projects:
○ GitHub: Explore trending repositories and search by technology.
○ GitLab & Bitbucket: Other repositories hosting open-source projects.
○ Open Source Initiative (OSI): Lists approved open-source projects.
○ Mozilla Open Source Support (MOSS): Supports various OSS projects.
○ Red Hat, Apache, Linux Foundation: Hosts various open-source projects.
1. GitHub
● Trending Repositories:
○ Visit GitHub Trending to find the most active repositories.
○ Filter by programming language and timeframe (daily, weekly, monthly).
● Explore Section:
○ Navigate to GitHub Explore to find curated lists and topics.
● Search by Technology:
○ Use https://github.com/search?q=keyword (replace keyword with tech stack like
Python, AI).
○ Example: https://github.com/search?q=Machine+Learning to find ML-related
projects.
● Labels for New Contributors:
○ Use tags like “good first issue”, “help wanted” to find beginner-friendly projects.
How GitHub Trending Works
The Trending page highlights repositories based on:
● Visit https://github.com/trending.
● The default page shows trending repositories across all languages.
● Filter by Timeframe:
○ Daily: Shows repositories gaining traction quickly.
○ Weekly: Highlights consistent growth in the last 7 days.
○ Monthly: Displays repositories with long-term engagement.
● Filter by Language:
○ Select a specific programming language (Python, JavaScript, C++, etc.).
○ Example: Trending Python Projects.
●
How to Use GitHub Trending
Step 3: Explore Repository Details
GitHub's Issues feature is a tool that helps developers and teams track tasks, report bugs, and discuss
project-related topics within a repository. Here's a simple breakdown:
Each issue can have a title, description, labels, assignees, and comments, facilitating organized and
transparent collaboration.
https://github.com/FreeTubeApp/FreeTube/issues
The FreeTube GitHub Issues page serves as a centralized platform where users and developers
collaborate to enhance the FreeTube application. Here's an overview of its structure and
functionality:
Labels are tags assigned to issues to categorize and highlight their nature. Common labels
include:
These labels assist in quickly identifying the nature of an issue and facilitate efficient triaging
and resolution.
Example Issues
1. [Bug]: [BAD_HTTP_STATUS: 403] Potential causes: IP block or streaming URL deciphering failed
○ Description: Users encounter a 403 error when attempting to play videos, possibly due to IP blocking
or issues with URL processing.
○ Discussion: The issue includes user reports, potential causes, and suggestions for troubleshooting.
○ Link: Issue #6701
2. [Bug]: Videos don't load, player continuously flickers
○ Description: Reports of videos failing to load, with the player flickering between sizes.
○ Discussion: Includes steps to reproduce the issue, user environment details, and possible fixes.
○ Link: Issue #5456
[Feature Request]: AppImageUpdate support
● Reporting New Issues: Providing detailed descriptions, steps to reproduce, and system
information.
● Commenting on Existing Issues: Sharing experiences, potential solutions, or additional
insights related to the issue.
● Following Up: Keeping track of issues you've reported or are interested in to provide additional
information or test potential fixes.
Active participation aids in the timely identification and resolution of problems, contributing to the
overall improvement of FreeTube.
https://github.com/FreeTubeApp/FreeTube/issues/6882
In the FreeTube GitHub repository, labels are used to categorize and manage issues effectively. Let's break down the specific
labels you've mentioned:
1. B: text/string
● Meaning: This label is applied to issues related to textual content within the application. It encompasses problems like
typos, grammatical errors, incorrect messages, or any discrepancies in the displayed text.
● Example: If a user notices a misspelled word in the user interface or an error message that's unclear, an issue would
be labeled with B: text/string.
2. U: reproduced
● Meaning: This label indicates that the reported issue has been successfully replicated by someone other than the
original reporter. Reproducing an issue is a crucial step in the debugging process, as it confirms the existence of the
problem under specified conditions.
● Example: After a user reports a bug, another contributor follows the described steps and encounters the same
problem. They then add the U: reproduced label to signify this confirmation.
3. bug
● Meaning: This is a standard label used across many GitHub repositories to denote an issue that describes an
unintended flaw or problem in the software. Bugs can range from minor glitches to significant errors affecting
functionality.
● Example: An issue reporting that the application crashes when a specific action is performed would be labeled as a
bug.
In the FreeTube GitHub repository, issue #6597, titled "[Bug]: catppuccinMocha: Color contrast for owner
comments is too low," was opened on January 16, 2025, by user artkapl. This issue highlights a problem
with the color contrast in the "catppuccinMocha" theme, specifically noting that comments from content
owners have insufficient contrast, making them difficult to read.
The issue has been labeled with several tags to categorize and manage it effectively:
● bug: Indicates that the issue is a software defect causing unintended behavior.
● good first issue: Suggests that this problem is suitable for newcomers to the project, likely because
it is self-contained and not overly complex.
● B: accessibility: Denotes that the issue pertains to accessibility concerns, focusing on making the
application usable for all individuals, including those with visual impairments.
● U: reproduced: Signifies that the issue has been confirmed by others who have experienced the
same problem, validating its existence.
In the FreeTube GitHub repository, labels are used to categorize and manage issues effectively. The label B:
Visual is likely a custom label created by the repository maintainers to denote issues related to the visual
aspects of the application. Here's a breakdown of its components:
● B: Prefix: In this context, B could stand for "Bug" or "Behavior," indicating that the issue pertains to a
problem or behavior within the application.
● Visual: This specifies that the issue is related to the visual elements of the application, such as the user
interface, layout, design inconsistencies, or graphical glitches.
Combining these, the B: Visual label likely identifies issues that involve visual bugs or unintended visual
behaviors in the application.
Here are few beginner-friendly tasks from the FreeTube project that you can undertake to start
contributing to open-source development:
● Set Up the Development Environment: Fork the FreeTube repository, clone it locally, and set
up the necessary dependencies.
● Engage with the Community: Comment on the issue you're interested in to express your
intent to work on it. This fosters communication and ensures no duplication of efforts.
● Research and Plan: Understand the existing codebase related to the issue. Plan your
approach before coding.
● Implement and Test: Develop the feature or fix, and thoroughly test it to ensure functionality
and compatibility.
● Submit a Pull Request (PR): Once satisfied with your solution, submit a PR for review,
adhering to the project's contribution guidelines.
How to Create an Issue
1. Navigate to the Repository: Go to the main page of the project on GitHub.
2. Access the Issues Tab: Click on the "Issues" tab located near the top of the page.
3. New Issue: Click the "New Issue" button.
4. Fill in Details: Provide a clear title and detailed description.
5. Submit: Click "Submit new issue" to post it.
A Project with Multiple Repositories
Let's say you're building a "Student Management System" which has:
GitHub Repositories:
● Each part of the system has different contributors (UI, Backend, Mobile).
● Easier to manage changes and updates independently.
Step-by-Step Guide
🔹 Step 1: Create Separate GitHub Repositories
1. Go to GitHub.
2. Click the "+" (plus icon) → Select "New Repository".
3. Enter Repository Name:
○ For frontend: student-management-frontend
○ For backend: student-management-backend
○ For mobile: student-management-mobile
4. Select Public or Private.
5. Click "Initialize this repository with a README" (optional).
6. Click "Create Repository".
7. Repeat these steps for all three repositories.
Step 2: Add Source Code Using GitHub UI
After creating each repository, we will upload the respective source code.
● You can create issues in your repository to plan, discuss, and track work.
● Issues are quick to create, flexible, and can be used in many ways.
● Issues can track bug reports, new features and ideas, and anything else you
need to write down or discuss with your team.
● You can also break your work down further by adding sub-issues and easily
browse the full hierarchy of work to be done.
Prerequisites
You can choose the most convenient method for your workflow.
Filling in information
Give your issue a descriptive title. The title should convey at a glance what the
issue is about.
Add a description that explains the purpose of the issue, including any details that
might help resolve the issue. For example, if this is a bug report, describe the
steps to reproduce the bug, the expected result, and the actual result.
You can use markdown to add formatting, links, emojis, and more.
About issues
Adding a task list
You can use plain text to track tasks that don't have a corresponding
issue and convert them to issues later.
Adding a task list
Adding labels
For example, you might use a bug label and a good first issue label to
indicate that an issue is a bug that a first-time contributor could pick up.
Users can filter issues by label to find all issues that have a specific label.
You can use the default labels, or you can create a new label.
Adding labels
Adding milestones
You can add a milestone to track the issue as part of a date based target.
A milestone will show the progress of the issues as the target date approaches.
Adding milestones
If your "set milestone" option on GitHub appears empty, it means that there
are currently no existing milestones created within that repository; to use
milestones, you need to first create a new milestone by going to the "Issues"
section of your repository and clicking "New Milestone.
Assigning the issue
To communicate responsibility, you can assign the issue to a member of your organization.
Adding milestones
You can add a milestone to track the issue as part of a date based target. A milestone
will show the progress of the issues as the target date approaches.
Adding the issue to a project
You can add the issue to an existing project and populate metadata for the project
Submitting your issue
You can edit any of the above fields after creating the issue.
Your issue has a unique URL that you can share with team members, or reference
in other issues or pull requests
Communicating
After your issue is created, continue the conversation by adding comments to the
issue. You can @mention collaborators or teams to draw their attention to a
comment. To link related issues in the same repository, you can type # followed
by part of the issue title and then clicking the issue that you want to link.
You can use issues for a wide range of purposes. For example:
● Tracking ideas
● Collecting feedback
● Planning tasks
● Reporting bugs
Issue template example
GitHub CLI is an open source tool for using GitHub from your computer's
command line. When you're working from the command line, you can use the
GitHub CLI to save time and avoid switching context.
You can open a new issue from a comment in an issue or pull request. When you
open an issue from a comment, the issue contains a snippet showing where the
comment was originally posted.
Creating an issue from code
You can open a new issue from a specific line or lines of code in a file or pull
request. When you open an issue from code, the issue contains a snippet showing
the line or range of code you chose.
You can only open an issue in the same repository where the code is stored.
Creating an issue from code
A simple task manager built using HTML, CSS, JavaScript, and a Flask backend
allows users to add, delete, and update tasks.
Reported Bug:
● Users reported that newly added tasks disappear when the page is refreshed.
Description: When I add a task, it appears in the list. But after refreshing, all tasks disappear. Expected
behavior: Tasks should be saved and persist even after refresh.
Reproducing the Bug
Steps to Reproduce:
Expected Behavior:
Actual Behavior:
Bug Analysis:
function addTask(task) {
tasks.push(task);
updateUI();
}
● The tasks array is stored in memory, so it disappears when the page reloads.
Fixing the Issue
Solution:
● Store tasks persistently using LocalStorage in the frontend or a database in the backend.
function saveTasksToLocalStorage() {
localStorage.setItem("tasks", JSON.stringify(tasks));
}
function loadTasksFromLocalStorage() {
const storedTasks = localStorage.getItem("tasks");
if (storedTasks) {
tasks = JSON.parse(storedTasks);
}
}
function addTask(task) {
tasks.push(task);
saveTasksToLocalStorage();
updateUI();
}
A Pull Request (PR) test in GitHub ensures that the proposed code changes fix a
reported bug without introducing new issues. Testing involves:
✔ Reviewing the changes.
✔ Running the code to verify the bug fix.
🛑 Simple Bug Issue
Issue Title:
Issue Description:
● The "Submit" button in the contact form does not work when clicked.
● Expected behavior: Clicking the button should display a success message.
● Actual behavior: Nothing happens when clicking the button.
Steps to Reproduce:
Bug Analysis:
function handleSubmit() {
alert("Form submitted successfully!");
}
Problem:
● The function exists but is not connected to the button click event.
🛠 Fixing the Issue
document.getElementById("submitBtn").addEventListener("click",
handleSubmit);
function handleSubmit() {
alert("Form submitted successfully!");
}
🔹 Fix:
def is_palindrome(number):
return str(number) == str(number)[::-1]
# User input
num_terms = int(input("Enter the number of terms for Fibonacci series: "))
fib_series = fibonacci_series(num_terms)
print("Fibonacci Series:", fib_series)
def is_palindrome(number):
return str(number) == str(number)[::-1]
# Welcome message
print("🔹🔹 Welcome to the Fibonacci and Palindrome Checker 🔹🔹\n")
while True:
print("\n Choose an option:")
print("1⃣ Generate Fibonacci Series")
print("2⃣ Check if a number is a Palindrome")
print("3⃣ Exit")
if choice == '1':
num_terms = int(input("\nEnter the number of terms for Fibonacci series: "))
fib_series = fibonacci_series(num_terms)
print(f"📌 Fibonacci Series ({num_terms} terms):", fib_series)
else:
print("⚠ Invalid choice! Please enter 1, 2, or 3.")
Managing Multiple Repositories Using Git (CLI)
Prerequisites
✔ Install Git (Download Git)
✔ Create a GitHub account (https://github.com/)
✔ Install Node.js (for backend) and React Native/Flutter (for mobile, if required)
Managing Multiple Repositories Using Git (CLI)
1⃣ Frontend (student-management-frontend)
2⃣ Backend (student-management-backend)
3⃣ Mobile (student-management-mobile)
1. Go to GitHub.
2. Click "+" (top-right corner) → New Repository.
3. Enter Repository Name:
○ Frontend: student-management-frontend
○ Backend: student-management-backend
○ Mobile: student-management-mobile
4. Choose Public or Private.
5. DO NOT initialize with README (we will create it later).
6. Click Create Repository.
7. Copy the repository URL for later use.
Step 2: Set Up the Repositories Locally Using Git
A branch is a separate copy of the code where developers can work on # Push the new branch to GitHub
git push origin feature-login
new features or fixes without affecting the main (stable) codebase.
✔ Prevents breaking the main code Once the feature is complete, it will be merged into the main branch
✔ Allows multiple developers to work in parallel using a Pull Request (PR).
✔ Keeps the main branch stable while testing new features
Example GitHub Issues:
Use GitHub Issues to Track Work
1. [Bug]: Student profiles not loading in the frontend.
What are GitHub Issues? 2. [Feature Request]: Add a "Forgot Password" feature.
3. [Enhancement]: Improve mobile responsiveness.
GitHub Issues allow teams to: ✔ Report bugs
✔ Suggest new features
✔ Discuss improvements
✔ Assign tasks to developers