Skip to content

Commit

Permalink
.
Browse files Browse the repository at this point in the history
  • Loading branch information
alanboy committed Mar 28, 2023
1 parent a385f65 commit 7449146
Show file tree
Hide file tree
Showing 3 changed files with 44 additions and 74 deletions.
66 changes: 3 additions & 63 deletions _posts/2023-03-27-INTRO.md
Original file line number Diff line number Diff line change
@@ -1,71 +1,11 @@
---
layout: post
title: "Introduction"
date: 2019-01-20 23:45:29 -0800
title: "What is DevMatch?"
date: 2023-03-27 23:45:29 -0800
categories: docs
---

This blog is a git repo hosted in GitHub. Every push to master triggers a CI build in AzureDevops which builds the site using Jekyll and pushes the results to a Blob Storage account in Azure. The Blob Storage has HTTP access enabled with a custom domain.

Building the jekyll site:

```
gem install bundler jekyll
bundle
bundle exec jekyll build
ls _site
```

Uploading the files to storage account:

```
#!/bin/bash
export AZURE_STORAGE_ACCOUNT="alanboyblog"
export container_name=\$web
cd _site
for f in $(find . -type f); do echo "Uploading ${f:2} ..."
&& az storage blob upload --container-name $container_name --file ${f:2} --name ${f:2} ;
done
```

I created a custom Jekyll theme that uses SeleniumUI for the HTML elements.

For the search, during build-time we create a js file which contains metadata for all the posts and provide that as an input to the search element.

To include mermaid, do this:

```
<div class="mermaid">
sequenceDiagram
Alice ->> Bob: Hello Bob, how are you?
Bob-->>John: How about you John?
Bob--x Alice: I am good thanks!
Bob-x John: I am good thanks!
</div>
```

```
<div class="mermaid">
graph TD
A[Christmas] -->|Get money| B(Go shopping)
B --> C{Let me think}
C -->|One| D[Laptop]
C -->|Two| E[iPhone]
C -->|Three| F[fa:fa-car Car]
</div>
```

## Some helpful links in the process
- https://alanboy.visualstudio.com/blog/_apps/hub/ms.vss-ciworkflow.build-ci-hub?_a=edit-build-definition&id=2&view=Tab_Triggers
- https://azure.microsoft.com/en-us/blog/azure-storage-static-web-hosting-public-preview/
- https://docs.microsoft.com/en-us/azure/storage/blobs/storage-custom-domain-name
- https://docs.microsoft.com/en-us/azure/storage/blobs/storage-quickstart-blobs-cli#specify-storage-account-credentials
- https://docs.microsoft.com/en-us/azure/storage/common/storage-azure-cli
- https://docs.microsoft.com/en-us/cli/azure/storage/blob/copy?view=azure-cli-latest#az-storage-blob-copy-start
- https://jekyllrb.com/docs/
- https://mermaid-js.github.io/mermaid-live-editor/#/edit/

# What is DevMatch?


50 changes: 41 additions & 9 deletions _posts/2023-03-27-INTRO2.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
---
layout: post
title: "Introduction"
title: "Creating a problem"
date: 2019-01-20 23:45:29 -0800
categories: docs
---
Expand All @@ -11,6 +11,7 @@ The DevMatch platform helps you to host short (1-hour) engineering challenges. T

DevMatch grabs concepts from competitive programming. You provide a statement to the participant and sometimes a starting point, like a pre-existing code repository. Then, the user changes the code or creates code from scratch that is submitted to DevMatch. DevMatch then runs the **evaluator**, which scores the solution based on pre-defined **test cases**. The test cases are returned to the user as a submission score.

<!--
::: mermaid
sequenceDiagram
autonumber
Expand All @@ -32,9 +33,8 @@ sequenceDiagram
Challenge->>DevMatch: Test cases
DevMatch->>User: Test cases
end

:::

-->

# Creating a challenge

Expand Down Expand Up @@ -67,6 +67,44 @@ You need to define the following:
* Integrate with DevMatch
* Make the UTs output a json that DevMatch can read

# Example

In this example we will create a challenge that asks a user to create a CLI tool. This tool will take two integers as arguments and print the sum of the two arguments. It should handle bad input such as non integers or the number of arguments.

* Prepare
* There is no specific job description for this challenge.
* We don't want to give the user any starting boilerplate code.
* Pending.
* The skills that we want to assess with this challange are: command line tools, nodejs, basic input output.
* Some test cases include adding two integers, negative numbers, zero arguments, one argument, three arguments.
* Design
* I will find a testing framework for CLIs
* Implementation.

I will start by creating an empty git repo where I can put my validator:

```
git init
```

Then, I need to create 3 folders, `problem`, `validator`, `docs`:

```
mkdir problem validator docs
```

* `problem` contains the root of the repo that the user will see.
* `validator` is where you write the code that validates the problem is correct.
* `docs` is where you save the statement

We don't want to give the user any starting point code, but we might want to add a readme.txt to problem for them to see. Let's start writing the validor.

## Validator

Ultimately, we need to be able to run something which will return a json describing the test cases. To be able to integrate with DevMatch this validaor needs to be written in node.js.



## Other considerations

* Installation of dependencies require resources out of the package managers main database?
Expand All @@ -80,9 +118,3 @@ DevMatch can use traditional CI/CD builds to run validators. DevMatch will need
* Continuously query the state of a given build by ID.
* Fetch artifacts from a finished build.

# Internal notes
[Hannah's framework](https://devmatch.sharepoint.com/:w:/r/sites/DevMatch/_layouts/15/Doc.aspx?sourcedoc=%7BFD30C7A3-00A1-4BA2-80F5-CC46DF7439F6%7D&file=Feedback%20for%20Take-home%20Framework.docx&action=default&mobileredirect=true&cid=c6c3b4e0-109d-4419-999f-b78af9bda7bc) for creating a take-home problem.

Isn't creating problems the same experience as creating a wiki page in Azure DevOps? Backed by git. But editable on the web with minimal burden.


2 changes: 0 additions & 2 deletions index.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,3 @@
layout: home
---


Test homepage

0 comments on commit 7449146

Please sign in to comment.