-
Notifications
You must be signed in to change notification settings - Fork 149
Contribute to an Existing Manifest
This page provides the best practice process for updating an existing manifest. For those less comfortable on the command-line and/or with git in general, you may find it useful to use the Github Desktop app. If you're new to Github Desktop, here's some helpful documentation.
Make sure you've enabled the Developer menu in ProfileCreator.
For those less familiar with git, the steps below are meant to be a guide for "best practices". They are by no means meant to be barriers to contributing. The best way to learn is by doing and working through the struggles therein. Especially if you are contributing for the first time, you'll find it easier to use existing preferences and/or other manifests as models. Refer to Manifest Format for more information.
If you're struggling, you can always shoot a message in the #profilemanifests channel on the MacAdmins Slack.
Know that some manifests have many of the same preferences, like Google Chrome, Brave, and Microsoft Edge, as well as the Restrictions payloads for macOS, iOS, and tvOS. As such, if changes are being made to any one of these they likely will need to be made elsewhere. See Related Manifests for more info.
- Fork the project on Github.
- Clone your fork to your local machine.
- Create a new branch from 'master' to work from.
Pre-commit is a way of catching common errors and helping to ensure standardization within a code project.
- Install pre-commit via your preferred method.
- Once, installed open a Terminal window and navigate to your ProfileManifests fork.
- Enable pre-commit by running:
pre-commit install
.
Note that manifests are located in & can be loaded from 2 different places:
- Within the ProfileManifests.framework built in the ProfileCreator app.
- These versions are in binary format
- In
~/Library/Application Support/ProfilePayloads
- These versions are in xml format
- Navigate to your local fork of the ProfileManifests repo and find the applicable manifest file.
You can more easily determine the name of this file by accessing the desired payload in ProfileCreator and clicking on the name at the top.
- Make a copy of the manifest in
~/Library/Application Support/ProfilePayloads
within the same manifests folder. This is the copy you'll work from.
- Open the copied manifest in your text editor of choice.
- If you don't have a text editor other than TextEdit, BBEdit, Sublime Text, Atom, and VSCodium are all free & fairly popular.
- Update the
pfm_last_modified
date. If you will be adding additional preferences, you should also bump thepfm_version
(notpfm_format_version
). It is not necessary to bump thepfm_version
otherwise.
ProfileCreator uses both
pfm_last_modified
&pfm_version
to determine the newest manifest to use.
- Add or update any needed preferences and save your changes to the manifest. Refer to the Manifest Format document as needed.
- In ProfileCreator, select
Developer > Reload Payload Manifest
from the menu bar to see your changes.
It can be beneficial to focus on a single preference at a time. Once you've made the desired changes and it's appearing in ProfileCreator correctly, committing each preference change to your fork can make it easier to read for those reviewing your code. When you make a lot of changes at once, it's easy to miss something or get something wrong.
- With your changes made, copy the updated manifest to the corresponding folder in your ProfileManifests fork.
- Commit the changes to your branch.
An example commit message: 'Add
<preference_key>
to <name_of_manifest>.plist'
- Make any necessary additional changes, save them, reload ProfileCreator, and commit until finished.
- Push your local changes up to your fork on Github.
- Once all changes have been pushed to your branch on Github, navigate to the ProfileManifests project.
- Having pushed your branch, you should see a button to create a Pull Request. Click this.
- Provide any applicable details in the PR description, including the documentation / URL you referenced (if not already included in
pfm_documentation_url
) and submit it.
Once your changes have been reviewed & your PR is accepted, you can safely delete the branch in your fork.
Should you want to continue contributing, as additional changes are made to the project by other contributors, your fork will no longer be in sync with the master branch of ProfileManifests. Before you can make any additional changes, make sure to complete these steps to sync your fork.
Alternatively, there is a 'Fetch upstream' button that you can click right from your fork in Github.