This guidance is to help website decision makers to understand why and how to share code.

There are a number of things that need to be considered when planning and developing a site on CWP that will make code sharing easier and possible. This page looks at the reasons why Government should share code, and the general approaches.

The other pages in this section cover:

Sharing code to reduce cost to government

The Common Web Platform has been set up as an all-of-government common capability and is part of a wider strategic goal that Investment and capability are shared ICT Strategy and Action Plan(external link)) Through code sharing, agencies can leverage investment made and reduce spend across the system.

As an open source product, CWP enables agencies to participate in the wider open source community by leveraging off existing modules and sharing modules that they create. Open sourcing modules contribute back to the community and benefits New Zealand, NGO's, and private companies.

Benefits of participating in the open source community by sharing code

Align with the Government's ICT Strategy

The vision for the New Zealand Government's ICT strategy is to have a single, coherent ICT ecosystem supporting radically transformed public services. This vision is support by code sharing on CWP as: 

  • Capabilities must be shared by default rather than by exception

  • Agencies will work together to deliver ICT enabled solutions as a matter of course

  • Focus on lowest total cost of ownership over time, delivering more affordable and sustainable services

Save time and money

When a government agency develops a feature for their website and then share it/open source it, other agencies (or anyone using SilverStripe) can use this without building the same or similar feature again. During this process features are improved, which helps the originating agency, as their feature (and site) will be continuously improved and therefore helps with ongoing maintenance fixing: 

  • Bugs
  • Browser and device compatibility
  • Web Accessibility Standards

Continuous improvement and ongoing maintenance

Sharing code enables people to help improve quality of code. When open sourcing a feature the originating agency has full control over what they accept back into their feature. So they keep control of the feature, and future improvements.

Approaches to code sharing

Agencies can decide on the approach they take to sharing code. These approaches are illustrated in the following image and can be summarised as: private - not shared at all; shared between agencies or websites; open-sourced for anyone to use.  

3 Approaches to code sharing

Keep it private

You can keep your code private, in your CWP Gitlab repository. This doesn't provide cost savings across the system, and you miss the opportunity to have your code improved by the open source community. Only code modules that hold sensitive configuration data, private information or have not been cleared by your security team should be kept private.

Share with other agencies on request

You can choose to share your code with another government agency. It is recommended to that if you share with another government agency you should open source the module to the wider SilverStripe community. However there may be business and security reasons why an agency would choose to only share with other CWP sites. This is a good first step for agencies that might be risk adverse to fully open sourcing their code.

Open source to the SilverStripe developer community

This should be the default. Unless there is a security risk, an agency should open source all modules that are created in their projects. By open sourcing modules agencies can get the benefits of the open source community making improvements on their code.

Last modified: