Skip to content

Commit 430a0a5

Browse files
Merge pull request #2891 from canonical/cand-dash-hv3
feat: migrate to harvest v3
2 parents 8cd5eae + 4cc544c commit 430a0a5

22 files changed

Lines changed: 1594 additions & 930 deletions

.env

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,8 @@ SECRET_KEY=local_development_fake_key
99

1010
# https://canonical.greenhouse.io/configure/dev_center/credentials
1111
GREENHOUSE_API_KEY=
12-
HARVEST_API_KEY=
12+
HARVEST_V3_CLIENT_ID=
13+
HARVEST_V3_CLIENT_SECRET=
1314
APPLICATION_CRYPTO_SECRET_KEY=super_secret
1415

1516
SERVICE_ACCOUNT_EMAIL=test_email@email.com

.github/workflows/deploy.yaml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,8 @@ jobs:
9393
env:
9494
SECRET_KEY: insecure_test_key
9595
APPLICATION_CRYPTO_SECRET_KEY: insecure_test_key
96-
HARVEST_API_KEY: local_development_fake_key
96+
HARVEST_V3_CLIENT_ID: local_development_fake_client_id
97+
HARVEST_V3_CLIENT_SECRET: local_development_fake_client_secret
9798
SERVICE_ACCOUNT_EMAIL: test_email@email.com
9899
SERVICE_ACCOUNT_PRIVATE_KEY: test_private_key
99100
run: |

.github/workflows/pr.yaml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,8 @@ name: PR checks
22
on: pull_request
33
env:
44
SECRET_KEY: insecure_test_key
5-
HARVEST_API_KEY: local_development_fake_key
5+
HARVEST_V3_CLIENT_ID: local_development_fake_client_id
6+
HARVEST_V3_CLIENT_SECRET: local_development_fake_client_secret
67
APPLICATION_CRYPTO_SECRET_KEY: insecure_test_key
78
SERVICE_ACCOUNT_EMAIL: test_email@email.com
89
SERVICE_ACCOUNT_PRIVATE_KEY: test_private_key

AGENTS.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -99,7 +99,7 @@ djlint templates/path/to/file.html --lint --profile=jinja # djlint for html/ji
9999
| Service | Purpose | Key Env Vars |
100100
| ------------- | -------------------------------- | ------------ |
101101
| Discourse API | Blog, takeovers, docs, tutorials | `DISCOURSE_API_KEY`, `DISCOURSE_API_USERNAME`, `MAAS_DISCOURSE_API_KEY`, `MAAS_DISCOURSE_API_USERNAME` |
102-
| Careers | Careers related | `HARVEST_API_KEY`, `APPLICATION_CRYPTO_SECRET_KEY` |
102+
| Careers | Careers related | `HARVEST_V3_CLIENT_ID`, `HARVEST_V3_CLIENT_SECRET`, `APPLICATION_CRYPTO_SECRET_KEY` |
103103
| Greenhouse | Candidate applications | `GREENHOUSE_API_KEY` |
104104
| Google Calendar | Google Calendar service-account auth | `SERVICE_ACCOUNT_EMAIL`, `SERVICE_ACCOUNT_PRIVATE_KEY` |
105105
| Marketo | Marketing / lead gen | `MARKETO_API_URL`, `MARKETO_API_CLIENT`, `MARKETO_API_SECRET` |
@@ -126,4 +126,4 @@ djlint templates/path/to/file.html --lint --profile=jinja # djlint for html/ji
126126
## Docs
127127

128128
- `README.md` — project overview, setup, development workflow, and common commands
129-
- `AGENTS.md` — instructions and conventions for AI agents/contributors working in the repository
129+
- `AGENTS.md` — instructions and conventions for AI agents/contributors working in the repository

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ Environment variables are read from the available shell. For the charm, these ar
4040

4141
## Greenhouse API
4242

43-
To work locally on the `/careers` section of the site, you will need to add a `HARVEST_API_KEY` environment variable to `.env` file. You can find this via the [Greenhouse admin panel](https://canonical.greenhouse.io/configure/dev_center/credentials).
43+
To work locally on the `/careers` section of the site, add `HARVEST_V3_CLIENT_ID` and `HARVEST_V3_CLIENT_SECRET` environment variables to your `.env.local` file.
4444

4545
# Deploy
4646

konf/site.yaml

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,9 +14,14 @@ env:
1414
key: greenhouse_api_key
1515
name: canonical-com
1616

17-
- name: HARVEST_API_KEY
17+
- name: HARVEST_V3_CLIENT_ID
1818
secretKeyRef:
19-
key: harvest_api_key
19+
key: harvest_v3_client_id
20+
name: canonical-com
21+
22+
- name: HARVEST_V3_CLIENT_SECRET
23+
secretKeyRef:
24+
key: harvest_v3_client_secret
2025
name: canonical-com
2126

2227
- name: APPLICATION_CRYPTO_SECRET_KEY

templates/careers/application/_activate-email.html

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,6 @@
55
<p>Thank you for the time you have spent on this application. We would love to collect your thoughts on our process and will shortly be sending you a candidate survey to complete via email. We would very much appreciate your time in helping us understand your feedback.</p>
66
<p>We would like to take this opportunity to wish you the very best with your next career steps.</p>
77
<p>Regards,</p>
8-
<p>{{ hiring_lead["name"] }}</p>
8+
<p>{{ hiring_lead["name"] if hiring_lead else "Talent team" }}</p>
99
<p>For further information on data collection, please refer to our <a href="/legal/data-privacy/recruitment" target="_blank">recruitment privacy notice</a> and <a href="/legal/data-privacy" target="_blank">privacy policy</a>.</p>
10-
</div>
10+
</div>
Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
<!DOCTYPE html>
2+
<!-- djlint:off H005 H016 H030 H031 -->
3+
<html>
4+
<head>
5+
<meta charset="utf-8">
6+
<meta name="viewport" content="width=device-width, initial-scale=1.0">
7+
</head>
8+
<body style="margin: 0; padding: 0; background-color: #f4f4f4; font-family: Ubuntu, 'Helvetica Neue', Helvetica, Arial, sans-serif; font-weight: 300; color: #222;">
9+
<table role="presentation" width="100%" cellpadding="0" cellspacing="0" style="background-color: #f4f4f4;">
10+
<tr>
11+
<td align="center" style="padding: 40px 20px;">
12+
<table role="presentation" width="600" cellpadding="0" cellspacing="0" style="background-color: #ffffff; border-radius: 4px;">
13+
<tr>
14+
<td style="padding: 40px;">
15+
<p style="margin: 0 0 16px; font-size: 16px; line-height: 1.6;">Dear {{ candidate_name }},</p>
16+
<p style="margin: 0 0 16px; font-size: 16px; line-height: 1.6;">This email is to acknowledge your withdrawal from consideration for this role. As we are closing your application, your Candidate Dashboard for this application will be deactivated shortly. Thank you for the time you have spent on this application and best wishes for your next career step.</p>
17+
<p style="margin: 0 0 24px; font-size: 16px; line-height: 1.6;">Regards,<br>{{ hiring_lead_name }}</p>
18+
<p style="margin: 0; font-size: 14px; line-height: 1.6; color: #666;">For further information on data collection, please refer to our <a href="https://ubuntu.com/legal/data-privacy/recruitment" style="color: #2b6cb0; text-decoration: none;">recruitment privacy notice</a> and <a href="https://ubuntu.com/legal/data-privacy" style="color: #2b6cb0; text-decoration: none;">privacy policy</a>.</p>
19+
</td>
20+
</tr>
21+
</table>
22+
</td>
23+
</tr>
24+
</table>
25+
</body>
26+
</html>
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
{% macro debug_email_notification(recipient, message, sender=None) %}
2+
<div class="u-fixed-width">
3+
<div class="p-notification--caution">
4+
<div class="p-notification__content">
5+
<h5 class="p-notification__title">[DEBUG] This email wasn't sent because you're in debug mode</h5>
6+
<p>The following email would have been sent to {{ recipient }}{% if sender %} from {{ sender }}{% endif %}:</p>
7+
<p><blockquote>{{ message | safe }}</blockquote></p>
8+
</div>
9+
</div>
10+
</div>
11+
{% endmacro %}

templates/careers/application/_withdrawal-form.html

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ <h2 class="u-no-margin--bottom" id="modal-title">Application withdrawal</h2>
1313
<label for="email">Email address</label>
1414
<input required type="email" id="email" name="email" placeholder="example@canonical.com" autocomplete="email"/>
1515
<label for="textarea">Reason you wish to withdraw your application</label>
16-
<select name="withdrawal-reason" id="withdrawal-reason" required>
16+
<select name="withdrawal-reason" id="withdrawal-reason" data-other-reason-value="{{ other_withdrawal_reason_value }}" required>
1717
<option value="" disabled="disabled" selected="">Select</option>
1818
{% for reason_id, reason_message in withdrawal_reasons.items() %}
1919
<option value="{{ reason_id }}">{{ reason_message }}</option>
@@ -30,4 +30,4 @@ <h2 class="u-no-margin--bottom" id="modal-title">Application withdrawal</h2>
3030
</div>
3131
</div>
3232
</section>
33-
</div>
33+
</div>

0 commit comments

Comments
 (0)