Skip to content

Commit

Permalink
Merge branch 'master' of https://github.com/nus-cs3281/2024
Browse files Browse the repository at this point in the history
  • Loading branch information
Misra Aditya committed Mar 2, 2024
2 parents d181524 + 061b7ec commit 8462c31
Show file tree
Hide file tree
Showing 32 changed files with 542 additions and 53 deletions.
17 changes: 9 additions & 8 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,13 @@ on: [push]
jobs:
build_and_deploy:
runs-on: ubuntu-latest
name: Build & Deploy to GitHub Pages
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
steps:
- uses: actions/checkout@v1
- name: Build & Deploy to GitHub Pages
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
GITHUB_REPOSITORY: ${{ secrets.GITHUB_REPOSITORY }}
GITHUB_ACTOR: ${{ secrets.GITHUB_ACTOR }}
BASE_URL: /2024
uses: MarkBind/markbind-action@1.0.0
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
with:
node-version: '16'
- run: npm i -g markbind-cli
- run: markbind deploy --ci
16 changes: 16 additions & 0 deletions students/EltonGohJH/knowledge.md
Original file line number Diff line number Diff line change
Expand Up @@ -63,3 +63,19 @@ The reason for this is that the developer of js-beautify has changed the way it
This caused a lot of tests to fail and I had to spend a lot of time debugging it.

Through this experience, I learned the importance of ensuring that changes are documented properly and correctly.

### gomock
I have learned to use GoMock, a mocking framework for Golang, which streamlines the creation of mock objects for unit testing. It helps with decoupling components, enabling the simulation of complex behaviors and interactions. I am surprised how easy it to use to mock complex behaviours.
Will definitely use it for Golang testing next time!

#### Resource used:
- [gomock docs](https://github.com/uber-go/mock)

### Yarn workspaces
Yarn Workspaces is a feature of Yarn that simplifies handling multiple packages within a single repository by enabling shared dependencies and centralized script management. I learnt Yarn Workspaces while setting up the repository for the Twenty project.
Overall, it is a good experience as I learnt more alternatives to Lerna and NPM workspaces.

#### Resource used:
- [Yarn workspaces docs](https://yarnpkg.com/features/workspaces)


28 changes: 24 additions & 4 deletions students/EltonGohJH/observations.md
Original file line number Diff line number Diff line change
@@ -1,11 +1,31 @@
### Project: Foo
### Projects I have worked on

#### Mattermost
Mattermost is an open-source collaboration platform designed for secure communication throughout the entire software development lifecycle. It serves as a self-hostable alternative to Slack, offering similar functionalities with the added benefit of full control over hosting and management.

### Twenty
Twenty CRM is a modern, open-source Customer Relationship Management (CRM) platform. It serves as an self-hostable alternative to Salesforce.

Give an intro to the project here ...

### My Contributions

Give a description of your contributions, including links to relevant PRs
In the [mattermost PR (approved not merged yet)](https://github.com/mattermost/mattermost/pull/26278). I addressed this [issue](https://github.com/mattermost/mattermost/issues/25991) where the CLI command to list the teams uses a magic number of 9999. Utilizing such large magic numbers presents two problems: it restricts the ability to list more than 9999 teams and could result in a request that is too large. To solve this, I implemented pagination for the request, with each page containing 200 teams. Subsequently, I updated the test cases to reflect the new expected behavior.

In the [Twenty PR (merged)](https://github.com/twentyhq/twenty/pull/4198). I addressed an [issue](https://github.com/twentyhq/twenty/issues/4181) reported by a user concerning LinkedIn school URLs not parsing correctly. Upon investigating the issue on the frontend, I discovered that the existing regex was only configured to support company URLs. To resolve this, I updated the regex to also accommodate school URLs and conducted tests to ensure the fix was effective.


### My Learning Record

Give tools/technologies you learned here. Include resources you used, and a brief summary of the resource.
### gomock
I have learned to use GoMock, a mocking framework for Golang, which streamlines the creation of mock objects for unit testing. It helps with decoupling components, enabling the simulation of complex behaviors and interactions. I am surprised how easy it to use to mock complex behaviours.
Will definitely use it for Golang testing next time!

#### Resource used:
- [gomock docs](https://github.com/uber-go/mock)

### Yarn workspaces
Yarn Workspaces is a feature of Yarn that simplifies handling multiple packages within a single repository by enabling shared dependencies and centralized script management. I learnt Yarn Workspaces while setting up the repository for the Twenty project.
Overall, it is a good experience as I learnt more alternatives to Lerna and NPM workspaces.

#### Resource used:
- [Yarn workspaces docs](https://yarnpkg.com/features/workspaces)
15 changes: 15 additions & 0 deletions students/EltonGohJH/progress.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
| Week | Achievements |
| ---- | ------------ |
| 1 | Help prepared idea & facilitated Saturday code sprint - MarkBind website making |
| 3 | Repo cleaning - Added tags to issues, added items to project road map, added summaries to issues, and cleaned up some issues. Examples: [Allow markbind serve to specify custom host #2382](https://github.com/MarkBind/markbind/issues/2382), [Optimize MarkBind for saving as PDF #2397](https://github.com/MarkBind/markbind/issues/2397), [UG: images appear in two places #2401](https://github.com/MarkBind/markbind/issues/2401) |
| 4 | Investigated: [UG: images appear in two places #2401](https://github.com/MarkBind/markbind/issues/2401) |
| 4 | Investigated and closed: [The collapsed page nav appears in the print view #2157](https://github.com/MarkBind/markbind/issues/2157) |
| 4, 5 | Reviewed: [MarkBind Template for Software Project Documentation #2400](https://github.com/MarkBind/markbind/pull/2400) |
| 5 | Reviewed: [Migrate stylelint to latest version #2292](https://github.com/MarkBind/markbind/pull/2425) |
| 5 | Discussed: [Use justified text formatting for tooltips #2420](https://github.com/MarkBind/markbind/issues/2420) |
| 5, 6 | Investigated and reviewed: [Fix external styles and script not hoisted #2414](https://github.com/MarkBind/markbind/pull/2414) |
| 6 | Reviewed: [Add line-numbers when wrapping is needed for printing #2431](https://github.com/MarkBind/markbind/pull/2431) |
| 6 | Investigated: [Tooltip artefact left over for annotation point #2432](https://github.com/MarkBind/markbind/issues/2432) |
| 6 | Reviewed and merged: [Disable pop over in a-point if there is no header and content passed by user #2436](https://github.com/MarkBind/markbind/pull/2436) |
| 6 | Investigated and fixed bug: [Utilize GitHub Actions to aid checking of commit message #2429](https://github.com/MarkBind/markbind/pull/2429) |
| 6 | Help fixed bug and merged: [Annotation content slot #2427](https://github.com/MarkBind/markbind/pull/2427) |
10 changes: 8 additions & 2 deletions students/KevinEyo1/knowledge.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,12 @@

List the aspects you learned, and the resources you used to learn them, and a brief summary of each resource.

### Tool/Technology 2
### GitHub Actions

...
Learned how GitHub Actions fits into the development workflow, and how to use it to automate tasks. I used the GitHub Actions documentation to learn about the different types of workflows, how to create and configure workflows, and how to use the different actions available.

- **Resource**: [GitHub Actions Documentation](https://docs.github.com/en/actions)
- **Summary**: GitHub Actions makes it easy to automate all your software workflows, now with world-class CI/CD. Build, test, and deploy your code right from GitHub. Make code reviews, branch management, and issue triaging work the way you want.

- **Resource**: [GitHub Actions Workflow Syntax](https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions)
- **Summary**: GitHub Actions uses YAML syntax to define the events, jobs, and steps that make up your workflow. You can create a custom workflow or use a starter workflow template to get started.
6 changes: 6 additions & 0 deletions students/KevinEyo1/progress.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
### MarkBind


| Week | Achievements |
| ---- | ------------ |
| 5 | Merged PR: [Enhance search performance of algolia plugin #2406]() |
30 changes: 30 additions & 0 deletions students/MarcusTXK/progress.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
| Week | Achievements |
| ---------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| 13/05/2023 | Reviewed PR: [Fix non-rendering PlantUML diagram #2005](https://github.com/reposense/RepoSense/pull/2005) |
| 28/06/2023 | Reviewed PR: [Incorrect dropdown box for config in UG: Customizing Report #2009](https://github.com/reposense/RepoSense/pull/2009) |
| 17/08/2023 | Reviewed PR: [Increase minimum version required for Git #2028](https://github.com/reposense/RepoSense/pull/2028) |
| 01/10/2023 | Reviewed PR: [Migrate build.gradle from Groovy to Kotlin #2008](https://github.com/reposense/RepoSense/pull/2008) |
| 01/10/2023 | Reviewed PR: [Migrate c-resizer.vue to typescript #2038](https://github.com/reposense/RepoSense/pull/2038) |
| 01/10/2023 | Reviewed PR: [Migrate random-color-gen.js to typescript #2043](https://github.com/reposense/RepoSense/pull/2043) |
| 30/10/2023 | Reviewed PR: [Update GitHub-specific references in codebase and docs #2050](https://github.com/reposense/RepoSense/pull/2050) |
| 30/10/2023 | Reviewed PR: [Add dynamic positioning support for tooltips #2056](https://github.com/reposense/RepoSense/pull/2056) |
| 30/10/2023 | Reviewed PR: [Fix tooltip zIndex such that it doesn't occlude next file title #2057](https://github.com/reposense/RepoSense/pull/2057) |
| 30/10/2023 | Reviewed PR: [Add contributors section to the README #2062](https://github.com/reposense/RepoSense/pull/2062) |
| 31/10/2023 | Reviewed PR: [Fix: Added contributors to the README.md #2064](https://github.com/reposense/RepoSense/pull/2064) |
| 02/11/2023 | Reviewed PR: [Created CONTRIBUTING.md #2065](https://github.com/reposense/RepoSense/pull/2065) |
| 23/12/2023 | Reviewed PR: [Reduce scope of try-catch block in ArgsParser::parse #2074](https://github.com/reposense/RepoSense/pull/2074) |
| 23/12/2023 | Reviewed PR: [Move TimeUtil ParseException throwing to ArgsParser::parse method #2075](https://github.com/reposense/RepoSense/pull/2075) |
| 23/12/2023 | Commented on Issue: [Reduce the scope of the try-catch block in ArgsParser::parse #1989](https://github.com/reposense/RepoSense/issues/1989) |
| 23/12/2023 | Created Issue: [Refactor RepoConfigCsvParser::processLine method to avoid arrowhead style code #2073](https://github.com/reposense/RepoSense/issues/2073) |
| 23/12/2023 | Created Issue: [Refactor RepoConfiguration to simplify constructor complexity #2076](https://github.com/reposense/RepoSense/issues/2076) |
| 1 | Reviewed PR: [Bump follow-redirects from 1.15.2 to 1.15.4 in /frontend #2079](https://github.com/reposense/RepoSense/pull/2079) |
| 1 | Reviewed PR: [Refactor RepoConfigCsvParser::processLine method to avoid arrowhead style code #2080](https://github.com/reposense/RepoSense/pull/2080) |
| 2 | Reviewed PR: [Remove hash symbol from URL when decoding hash #2086](https://github.com/reposense/RepoSense/pull/2086) |
| 2 | Reviewed PR: [Remove redundant User class #2093](https://github.com/reposense/RepoSense/pull/2093) |
| 2 | Reviewed PR: [Add cypress tests for renderFilterHash #2017](https://github.com/reposense/RepoSense/pull/2017) |
| 2 | Reviewed PR: [Improve memory usage by refactoring Regex compilation #2092](https://github.com/reposense/RepoSense/pull/2092) |
| 3 | Reviewed PR: [Use syntax coloring for code blocks in docs #2099](https://github.com/reposense/RepoSense/pull/2099) |
| 3 | Closed Issue: [Forward/Backward Navigation Using Browser Buttons #2090](https://github.com/reposense/RepoSense/issues/2090) |
| 4 | Reviewed PR: [Updating SystemTestUtil::assertJson to compare Json objects instead of line-by-line analysis #2087](https://github.com/reposense/RepoSense/pull/2087) |
| 4 | Reviewed PR: [Refactor RepoConfiguration to simplify constructor complexity #2078](https://github.com/reposense/RepoSense/pull/2078) |
| 5 | Created Issue: [Fix failing cypress test for range changes in chartview #2111](https://github.com/reposense/RepoSense/issues/2111) |
30 changes: 26 additions & 4 deletions students/NereusWB922/knowledge.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,29 @@
### Tool/Technology 1
### Angular

List the aspects you learned, and the resources you used to learn them, and a brief summary of each resource.
#### **Attribute Directive**:
- **Summary**: Attribute directives can change the appearance or behavior of DOM elements and Angular components.
- **Resources**:
- [Angular Documentation](https://angular.io/guide/attribute-directives): Provides guidelines on creating and applying attribute directive, covering user events handling and passing values to attribute directive.
- **Practice**:
- [PR #1239](https://github.com/CATcher-org/CATcher/pull/1239): Created an attribute directive that listen to click event and will open error snackbar if the target link is an internal link.

### Tool/Technology 2
#### **Components**:
- **Summary**: Components are the main building blocks for Angular. Each components consists of 3 files:
- HTML: Defines the layout of the component's view.
- CSS: Defines the component-specific styles.
- Typescript: Implements the component's logic and behavior.
- **Resources**:
- [Angular Documentation](https://angular.io/guide/component-overview): Provides guidelines on creating components.
- Previous code by other developers: Learned from existing component implementations in the codebase.
- **Practice**:
- [PR #233](https://github.com/CATcher-org/WATcher/pull/233): Edited exsiting component and created new component to improve WATcher activity dashboard.

...
### Jasmine
Jasmine is a behavior-driven development framewrok specific for JavaScript unit testing.

I primarily learned how to use Jasmine from its [documentation](https://jasmine.github.io/api/edge/global). I utilized it extensively while working on WATcher test case refactoring. Some relevant PRs include: [PR #241](https://github.com/CATcher-org/WATcher/pull/241), [PR #244](https://github.com/CATcher-org/WATcher/pull/244), [PR #245](https://github.com/CATcher-org/WATcher/pull/245), [PR #246](https://github.com/CATcher-org/WATcher/pull/246), [PR #247](https://github.com/CATcher-org/WATcher/pull/247)

- **`describe`**: Define a group of spec (suite)
- **`it`**: Define a single spec.
- **`expect`**: Create an expectation for a spec.
- **Class `Spy`**: Mock functions (spies) that can be used to track function calls.
13 changes: 13 additions & 0 deletions students/NereusWB922/progress.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
| Week | Achievements |
| ---- | ------------ |
| 3 | Merged PR: [Uncaught error when invalid link is clicked #1239](https://github.com/CATcher-org/CATcher/pull/1239) |
| 4 | Merged PR: [Improve activity dashboard design #233](https://github.com/CATcher-org/WATcher/pull/233) |
| 4 | Merged PR: [Refactor test cases for Login Component, Session Model and Conflict Model #241](https://github.com/CATcher-org/WATcher/pull/241) |
| 4 | Merged PR: [Remove markdown.css from test env stylesheets #243](https://github.com/CATcher-org/WATcher/pull/243) |
| 4 | Merged PR: [Refactor test cases for issue paginator #244](https://github.com/CATcher-org/WATcher/pull/244) |
| 4 | Merged PR: [Refactor test cases for issue sorter #245](https://github.com/CATcher-org/WATcher/pull/245) |
| 4 | Merged PR: [Refactor github label constants #246](https://github.com/CATcher-org/WATcher/pull/246) |
| 4 | Merged PR: [Refactor test cases for search filter #247](https://github.com/CATcher-org/WATcher/pull/247) |
| 6 | Reviewed PR: [Refactor certain filters into its own service #259](https://github.com/CATcher-org/WATcher/pull/259) |
| 6 | Merged PR: [Remove test cases for permissions service #260](https://github.com/CATcher-org/WATcher/pull/260) |
| 6 | Submitted issue: [Improve E2E testing #1251](https://github.com/CATcher-org/CATcher/issues/1251) |
46 changes: 43 additions & 3 deletions students/Tim-Siu/knowledge.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,47 @@
### Tool/Technology 1
## markdown-it

MarkBind uses `markdown-it` for rendering html from markdown files. `markdown-it` is a fast markdown parser and has very extensive plugins support and great extensibility.

### Adding custom rules to `markdown-it` through adding a rule to `markdown-it`'s attribute

Adding custom rules to `markdown-it` can be done easily by adding a rule to the attribute.
For example, if we want to add our rules for rendering fenced code blocks, we can do so by adding a rule to the `markdown-it`'s attribute.

```javascript
markdownIt.renderer.rules.fence = (tokens: Token[],
idx: number, options: Options, env: any, slf: Renderer) => {}
```

**Parameters**

* **tokens (Token[]):** An array of Token objects. Each token represents a segment of the parsed Markdown content. Tokens of particular interest for the fence rule include:
- `token.type`: The type of the token (e.g., 'fence', 'code', 'paragraph').
- `token.info`: Contains the language specified after the opening set of backticks, if any, plus additional options.
- `token.content`: The text content within the fenced code block.
* **idx (number):** The index of the current `fence` token within the `tokens` array. This lets us find tokens before and after the fence if needed.
* **options (Options):** This object contains global options passed to the Markdown-it parser. This could include settings specific to our setup.
* **env (any):** An object containing environment variables and potentially additional data derived from the parsed Markdown. This can be useful for accessing context when defining rendering logic.
* **slf (Renderer):** A reference to the Markdown-it Renderer object itself. This is primarily used when we need to call other rendering rules to process nested Markdown code within the fenced block.

**Purpose of the fence renderer rule**

The `markdownIt.renderer.rules.fence` function is responsible for taking a `fence` token (representing a fenced code block) and converting it into the appropriate HTML output. This could include syntax highlighting, if our setup supports it.

**How it Works**

Inside the function, we have access to all the information in the tokens, options, and the environment. We can craft custom logic to generate the desired HTML structure for our fenced code blocks. Here's a very basic example:

```javascript
markdownIt.renderer.rules.fence = (tokens, idx, options, env, slf) => {
const token = tokens[idx];
const content = token.content;
const language = token.info.trim(); // Language after the opening backticks

return `<pre><code class="language-${language}">${content}</code></pre>`;
};
```

List the aspects you learned, and the resources you used to learn them, and a brief summary of each resource.

### Tool/Technology 2

...
...
Loading

0 comments on commit 8462c31

Please sign in to comment.