on master help sign in
streamly/docs/Developer/MAINTAINING.md
422 lines 17 kB history raw
1# Maintainers' Guide
3## PR Merge Checklist
5* All the CI tests pass
6* New tests are added where applicable
7* Benchmarks are added where applicable
8* Run benchmarks locally if you suspect any regressions
9* Documentation is added for any new combinators
10 * New combinators have time and space complexity annotations
11 * New combinators have `since` annotation
12* Changelog entry is added for exposed combinators.
13* Identify breaking changes, or changes that may require depndency
14 version bound changes. See https://pvp.haskell.org/. Also see the
15 "Breaking changes section below".
16* Optionally, look at hlint output if anything in that is worth fixing.
17* Merge the PR by rebasing. Note that github always creates new commits when
18 merged with rebase, it records the committer as well as the author in the
19 commit. This makes the local branch diverge from master. You can rebase and
20 merge the commit manually in your local git tree and push the resulting
21 master branch to avoid new commits and divergence from the original tree.
23## Release Checklist
25* Check if any critical pending bugs or issues are to be included
26* If this is a major release check if any previously deprecated features are to
27 be removed in this release.
28* Check pre-release APIs to be exposed, especially from streamly-examples
29* PVP is adhered to, additionally do not change pre-release APIs in a
30 minor release
32* _Documentation_:
34 * Documentation is updated.
35 * Check if all the links in the docs are stable.
36 * External links might point to the `master` branch of a few
37 repositories. Pin them to a specific version that works with the current
38 release.
39 * You can run `rg '/blob/'` and `rg '/tree/'` to search for github links.
40 * For example, links that point to `streamly-examples` point to its
41 `master` branch. Instead, while making the release we need to pin the
42 links to a specific revision that works with the latest commit of the
43 current release.
44 * Ideally, the distribution process should automatically replace these
45 with current stable references.
46 * The markdown documentation files have no broken links. See the section
47 about [checking for broken
48 links](#checking-for-broken-links-in-the-markdown-files) for more info.
49 * Haddock docs are consistent with the changes in the release
50 * Tutorial has been updated for new changes
51 * Documents in the `docs` directory are consistent with new changes
52 * All combinators have time and space complexity annotations
53 * All combinators have `since` annotation
54 * Modules that were renamed or APIs that moved to other modules should be
55 marked as "since" the current release.
56 * Check all released modules to ensure that they do not have any leftover
57 `Internal` or `Pre-release` annotations.
58 * Unreleased combinators should be marked with `Pre-release` or
59 `Internal` annotations
60 * Streamly homepage is updated with the release docs
61 * FileSystem.Event.Windows/Darwin modules require special handling
63* _Build and Test_:
65 * All CIs are green
66 * Run tests using bin/test.sh to test with memory restrictions
67 * Manually build and test for all flags (esp. `dev` flag) not covered by CIs
68 * Test prime GHC version with -O0 and -O1
70* _Benchmarks_:
72 * Check regressions from previous release
73 * Run benchmarks with large stream size (`bench-runner --long --quick`) to
74 check for space leaks and to ensure constant memory usage for streaming
75 operations.
76 * Run benchmarks with `dev` flag on. Some `fileio` benchmarks are disabled
77 in regular runs.
78 * Check comparative benchmarks using streaming-benchmarks
80* _Dependencies_:
82 * Make sure all dependency bounds can use latest versions
83 * Update `stack.yaml` to latest stable resolver, cleanup extra-deps
84 * Make sure fusion-plugin is up to date and uploaded
85 * Check the dependency footprint of the library. See
86 [Generating Dependency Graph](#generating-dependency-graph) section.
88* _Dependent Packages_:
90 * Update
91 [streamly-examples](https://github.com/composewell/streamly-examples)
92 to make sure it runs with the latest release.
93 * Check the performance of examples where applicable
94 * Update:
95 * streamly-bytestring
96 * streamly-process
97 * streamly-lz4
99* _Update Package Metadata:_
101 * Make sure the description in cabal file is in sync with the docs
102 * Make sure CI configs include last three major releases of GHC in CI testing.
103 * Update GHC `tested-with` field
104 * Update `docs/Compiling.md` with the distributions tested with
105 * Any docs linked inside haddock/cabal/changelog or any other such file
106 should go in the extra-doc-files section instead of
107 extra-source-files. Otherwise hackage shows the links as broken.
108 * Make sure any additional files are added to `extra-source-files` in cabal
109 file. Artifacts required for build, test, benchmarks, docs, licenses
110 should be packaged. Build environment customization may or may not be
111 packaged.
113* _Copyrights and Contibutors_
115 * Make sure contributors to the release are listed in `docs/CONTRIBUTORS.md`
116 under the current release title.
117 * Make sure any third party code included in the release has been listed in
118 `docs/Credits.md` and the license is added to the repo.
120* _Update changelog & Version_:
122 * Find API changes using `./packdiff streamly ver1 streamly ver2`
123 and record them in `docs/User/ProjectRelated/ApiChangelogs/ver1-ver2.txt`.
124 * Make sure all the bug fixes being included in this release are marked
125 with a target release on github. So that users can search by release if
126 they want.
127 * Make sure the package version in configure.ac has the correct release
128 version, else set the version correctly and run autoreconf. This might
129 need to be done for a minor release.
130 * Make sure the `Unreleased` section at the top of changelog file has the
131 new release version number and the month/year of publishing.
132 * Make sure the package version in the cabal file and package.yaml has the
133 correct release version, else set the version correctly. This might need
134 to be done on a minor release.
135 * Bump the package version in any docs/links, use something like
136 `rg '0\.8\.'|grep -v -i since` to find any remaining occurrences of the
137 old release. Check `rg -i unreleased` for any remaining todos.
139* _Upload_:
141 * Wait for final CI tests to pass:
143 * Manually run packcheck for ghcjs, `bin/run-ci.sh --targets ghcjs`.
144 * Mask out the build status lines from the
145 [README](/docs/User/ProjectRelated/README.md)
146 * Upload to hackage
147 * Use a clean workspace to create source distribution
148 by freshly cloning the git repository. The reason for
149 doing this is that we use wild-cards in cabal file for
150 `extra-source-files`, these wild-cards may match additional
151 files lying around in the workspace and unintentionally ship
152 them as well.
153 * Upload and verify the candidate
154 * `cabal v2-sdist; cabal upload <tarpath>`
155 * `cabal v2-haddock --haddock-for-hackage --enable-doc; cabal upload -d <tarpath>`
156 * Publish the package
157 * `cabal v2-sdist`; `cabal upload --publish <tarpath>`
158 * Run packcheck on the uploaded package. To get the latest uploaded
159 version from hackage, run `cabal unpack <package-name>`. You might
160 have to run `cabal update`.
161 * Create a git tag of the form P-X.Y.Z corresponding to the release
162 where X.Y.Z is the new package version and P is the package name (`git
163 tag P-X.Y.Z && git push -f origin P-X.Y.Z`). If the package name is
164 implicit, P can be omitted and the tag can be of the form vX.Y.Z
165 * Add to stackage (`build-constraints.yaml` in Stackage repo) if needed
166 * Update and if needed release streaming-benchmarks package
167 * Check https://matrix.hackage.haskell.org/package/streamly
168 * Check haddocks on Hackage, upload if not built
169 * Announce to haskell-cafe@haskell.org
171### Post Release Tasks
173* _Bump package version_:
174 * After a major release, bump the package version in cabal file or
175 package.yaml to the next major release target.
176 * Bump the package version in configure.ac to the next major release target
177 and run autoreconf.
178 * Sync the package version of `streamly` and `streamly-docs`.
179 * Add an `Unreleased` section at the top of changelog file with the next
180 major release target.
182## Breaking Changes
184This section lists what constitutes breaking changes. See
185https://pvp.haskell.org/ breaking changes that can be determined by the
186API alone. We specify some additional recommendations here:
188Behavior changes, this kind of changes are nasty and should be avoided. If such
189changes are made they should be emphasized adequately in the changelog:
191* Silent changes in the behavior of an API without any changes to the
192 signature.
193* Even fixing a bug could break things as users may have employed workarounds
194 for the bug.
195* Changes in the behavior of a dependency may also cause a change in behavior.
197Be cautious about the following:
199* Change in version bounds of dependencies may cause compilation failure for
200 some programs because they may not be able to find a build plan.
201* Ideally, new warnings should not be considered breaking, dependencies
202 should never be compiled with -Werror. But packages may not be following
203 it perfectly.
204* Deprecating an API may issue new warnings, however the code can still be
205 compiled if warnings are not treated as errors.
207Internal APIs:
209* Internal APIs can change without having to change the major version. However,
210 we should try to align the Internal API changes with a major release as long
211 as possible.
213## Managing Issues
215We label the issues in different dimensions based on the lifecyle and different
216management aspects of the issue. The folowing sections discuss the labels used
217to manage the issues. If a new label is required, it should be discussed before
218creating it.
220### Disposition
222The level-1 triaging of the issue determines the current disposition
223of the issue. If no change is required the issue must have one of the
224following labels:
226* disposition:invalid
227* disposition:question
228* disposition:discussion
229* disposition:duplicate
230* disposition:wontfix
232If a change is required we need to do level-2 triage of the issue, see the
233sections below.
235### Change type
237When a change is required we need to put one of the __change type__
238labels as part of level-2 triaging:
240* type:performance: User visible impact on performance.
241* type:testing: Improves testing or related to testing.
242* type:usability: It is not convenient to use the library.
243* type:documentation: documentation is not correct or sufficient.
244* type:bug: A functionality issue, not working as expected.
245* type:enhancement: includes a new feature or enhancement
246* type:maintenance: A refactor or any other change with no user visible impact.
248### Aspect
250In addition we can put a __product aspect__ label describing a feature name or
251any other product specific classification bucket.
253* aspect:<aspect name>
255### Severity
257Optionally we can add a severity label to indicate how severe is the
258impact of the bug/issue, which may determine how important it is to fix it. By
259default the severity is normal, if it is high we put a label:
261* severity:high
263### API impact
265For a user visible issue whether it has a release/changelog impact:
267* api:new: includes a new feature or enhancement
268* api:breaking: has a breaking impact on existing deployments
269* api:deprecating: deprecates an existing functionality
271__RULE__: Any commit that may affect the end user in some way MUST have
272either a changelog entry OR MUST have an issue marked with one of the
273above labels OR both.
275### Priority
277By default the issues are normal priority. We use a label for high priority
278issues:
280* priority:high
282### Scheduling
284If the issue is assigned to someone then it is considered scheduled. Otherwise
285it is unscheduled. Unassigned issues may have the following labels:
287* sched:deferred: deliberately deferred for some reason.
288* sched:blocked: blocked on any other fix or a decision to be mad
290### For Contributors
292* help-wanted: anyone can take the issue and contribute
293* good-first-issue: good for new contributors
295## Correlating Changes, Issues and Releases
297For planning purposes, open issues may be marked with milestones or target
298releases. However, it may not always be known which release a fix will finally
299land in. For example, we may decide to make a minor release instead of a major
300one if there are no breaking changes yet, so we may not always know what would
301be the next release version.
303Trackability means that we should be able to find which issues got fixed in
304which release. Or what all issues got fixed in a particular release. We track
305significant changes using the changelog. However, there may be more changes
306that can only be tracked via issues, PRs or commits. When we make a release we
307can mark all the issues fixed in that release with a correct release target for
308future trackability.
310For better trackability of which issue got fixed in which release we need the
311following:
313* Before you close an issue make sure a commit or a PR fixing the issue is
314 attached with it. In the commit message you can reference an issue like
315 "fixes #50", you can do the same in a PR as well.
316* Before we make a new release EVERY issue with a commit included in that
317 release that affects the end user, especially bugs and breaking changes MUST
318 have the target release correctly set.
320## Changelog Management
322Keep the unreleased changes in the `Unreleased` section at the top of changelog
323file. Using `Unreleased` instead of the next release number for unreleased
324changes is important. First, we do not know the next release number in advance,
325it could be a major or minor release. Second, if we use the next release
326number instead, then when adding a new change to the changelog, at one look we
327cannot know whether the release number on top is unreleased or released.
329## TODO
331* GPG signed releases and tags
333## Generating Dependency Graph
335Ways to get the dependencies. In the streamly package top dir:
337```
338# Keep only streamly in the packages section of stack.yaml
339$ stack --system-ghc dot . --external|dot -Tpdf > streamly.pdf
340```
342Using nix, remove the test and benchmark components from
343`shellFor/packages` in `default.nix` to get library only
344dependencies. May show additional ghc boot libraries.
346```
347$ nix-shell --run "ghc-pkg dot | dot -Tpdf > streamly.pdf"
348```
350## Checking for broken symlinks
352The following command - when run from the repository root - finds all the
353broken symlinks in the project.
355```
356find . -xtype l \
357 -not -path "./dist*" \
358 -not -path "./.stack*" \
359 -not -path "./benchmark/bench-report/dist*"
360```
362## Checking for broken links in the markdown files
364You can use [markdown-link-check](https://github.com/tcort/markdown-link-check)
365for finding broken links.
367You can run it using `npx` like so:
368```
369npx markdown-link-check <markdown-file>
370```
372The following command - when run from the repository root - finds all the
373markdown files that we need to consider:
375```
376find . -type f -name "*.md" \
377 -not -path "./dist*" \
378 -not -path "./.stack*" \
379 -not -path "./benchmark/bench-report/dist*"
380```
382The following executes the markdown link checking with proper configuration on
383the results. This also checks all the links are absolute to the root of the
384repo.
386```
387find . -type f -name "*.md" \
388 -not -path "./dist*" \
389 -not -path "./.stack*" \
390 -not -path "./benchmark/bench-report/dist*" \
391 -exec npx markdown-link-check -c /dev/stdin --quiet {} \; <<EOF
393 "ignorePatterns": [
394 {
395 "pattern": "^http"
396 },
397 {
398 "pattern": "^ftp"
399 },
400 {
401 "pattern": "^mailto"
402 }
403 ],
404 "replacementPatterns": [
405 {
406 "pattern": "^", "replacement": "{{BASEURL}}"
407 }
408 ]
410EOF
411```
413Once you run that, you can check all the links again without the config,
414filtering in only `http`, `ftp`, and `mailto` links.
416```
417find . -type f -name "*.md" \
418 -not -path "./dist*" \
419 -not -path "./.stack*" \
420 -not -path "./benchmark/bench-report/dist*" \
421 -exec npx markdown-link-check --quiet {} \; 2>&1 | grep -e "http" -e "ftp" -e "mailto"
422```