Managing Dev Environments with Amazon CodeCatalyst

An Amazon CodeCatalyst Dev Environment is a cloud-based development environment that you can use in CodeCatalyst to quickly work on the code stored in the source repositories of your project. The project tools and application libraries included in your Dev Environment are defined by a devfile in the source repository of your project.

Introduction

In the previous CodeCatalyst post, Team Collaboration with Amazon CodeCatalyst, I focused on CodeCatalyst’s collaboration capabilities and how that related to The Unicorn Project’s main protaganist. At the beginning of Chapter 2, Maxine is struggling to configure her development environment. She is two days into her new job and still cannot build the application code. She has identified over 100 dependencies she is missing. The documentation is out of date and nobody seems to know where the dependencies are stored. I can sympathize with Maxine. In this post, I will focus on managing development environments to show how CodeCatalyst removes the burden of managing workload specific configurations and produces reliable on-demand development environments.

Prerequisites

If you would like to follow along with this walkthrough, you will need to:

Have an AWS Builder ID for signing in to CodeCatalyst.

Belong to a space and have the space administrator role assigned to you in that space. For more information, see Creating a space in CodeCatalystManaging members of your space, and Space administrator role.

Have an AWS account associated with your space and have the IAM role in that account. For more information about the role and role policy, see Creating a CodeCatalyst service role.

Walkthrough

As with the previous posts in our CodeCatalyst series, I am going to use the Modern Three-tier Web Application blueprint.  Blueprints provide sample code and CI/CD workflows to help make getting started easier across different combinations of programming languages and architectures. To follow along, you can re-use a project you created previously, or you can refer to a previous post that walks through creating a project using the blueprint.

One of the most difficult aspects of my time spent as a developer was finding ways to quickly contribute to a new project. Whenever I found myself working on a new project, getting to the point where I could meaningfully contribute to a project’s code base was always more difficult than writing the actual code. A major contributor to this inefficiency, was the lack of process managing my local development environment. I will be exploring how CodeCatalyst can help solve this challenge.  For this walkthrough, I want to add a new test that will allow local testing of Amazon DynamoDB. To achieve this, I will use a CodeCatalyst dev environment.

CodeCatalyst Dev Environments are managed cloud-based development environments that you can use to access and modify code stored in a source repository. You can launch a project specific dev environment that will automate check-out of your project’s repo or you can launch an empty environment to use for accessing third-party source providers.  You can learn more about CodeCatalyst Dev Environments in the CodeCatalyst User Guide.

Figure 1. Creating a new Dev Environment

To begin, I navigate to the Dev Environments page under the Code section of the navigaiton menu.  I then use the Create Dev Environment to launch my environment.  For this post, I am using the AWS Cloud9 IDE, but you can follow along with the IDE you are most comfortable using.  In the next screen, I select Work in New Branch and assign local_testing for the new branch name, and I am branching from main.  I leave the remaining default options and Create.

Figure 2. Dev Environment Create Options

After waiting less than a minute, my IDE is ready in a new tab and I am ready to begin work.  The first thing I see in my dev environment is an information window asking me if I want to navigate to the Dev Environment Settings.  Because I need to enable local testing of Dynamodb, not only for myself, but other developers that will collaborate on this project, I need to update the project’s devfile.  I select to navigate to the settings tab because I know that contains information on the project’s devfile and allows me to access the file to edit.

Figure 3. Toolkit Welcome Banner

Devfiles allow you to model a Dev Environment’s configuration and dependencies so that you can re-produce consisent Dev Environments and reduce the manual effort in setting up future environments.  The tools and application libraries included in your Dev Environment are defined by the devfile in the source repository of your project.  Since this project was created from a blueprint, there is one provided.  For blank projects, a default CodeCatalyst devfile is created when you first launch an environment.  To learn more about the devfile, see https://devfile.io.

In the settings tab, I find a link to the devfile that is configured.  When I click the edit button, a new file tab launches and I can now make changes.  I first add an env section to the container that hosts our dev environment.  By adding an environment variable and value, anytime a new dev environment is created from this project’s repository, that value will be included.  Next, I add a second container to the dev environment that will run DynamoDB locally.  I can do this by adding a new container component.  I use Amazon’s verified DynamoDB docker image for my environment. Attaching additional images allow you to extend the dev environment and include tools or services that can be made available locally.  My updates are highlighted in the green sections below.

Figure 4. Example Devfile

I save my changes and navigate back to the Dev Environment Settings tab. I notice that my changes were automatically detected and I am prompted to restart my development environment for the changes to take effect.  Modifications to the devfile requires a restart. You can restart a dev environment using the toolkit, or from the CodeCatalyst UI.

Figure 5. Dev Environment Settings

After waiting a few seconds for my dev environment to restart, I am ready to write my test.  I use the IDE’s file explorer, expand the repo’s ./tests/unit folder, and create a new file named test_dynamodb.py.  Using the IS_LOCAL environment variable I configured in the devfile, I can include a conditional in my test that sets the endpoint that Amazon’s python SDK ( Boto3 ) will use to connect to the Dynamodb service.  This way, I can run tests locally before pushing my changes and still have tests complete successfully in my project’s workflow.  My full test file is included below.

Figure 6. Dynamodb test file

Now that I have completed my changes to the dev environment using the devfile and added a test, I am ready to run my test locally to verify.  I will use pytest to ensure the tests are passing before pushing any changes.  From the repo’s root folder, I run the command pip install -r requirements-dev.txt.  Once my dependencies are installed, I then issue the command pytest -k unit.  All tests pass as I expect.

Figure 7. Pytest test results

Rather than manually installing my development dependencies in each environment, I could also use the devfile to include commands and automate the execution of those commands during the dev environment lifecycle events.  You can refer to the links for commands and events for more information.

Finally, I am ready to push my changes back to my CodeCatalyst source repository.  I use the git extension of Cloud9 to review my changes.  After reviewing my changes are what I expect, I use the git extension to stage, commit, and push the new test file and the modified devfile so other collaborators can adopt the improvements I made.

Figure 8.  Changes reviewed in CodeCatalyst Cloud9 git extension.

Cleanup

If you have been following along with this workflow, you  should delete the resources you deployed so you do not continue to incur  charges. First, delete the two stacks that CDK deployed using the AWS CloudFormation console in the AWS account you associated when you launched the blueprint. These stacks will have names like mysfitsXXXXXWebStack and mysfitsXXXXXAppStack. Second, delete the project from CodeCatalyst by navigating to Project settings and choosing Delete project.

Conclusion

In this post, you learned how CodeCatalyst provides configurable on-demand dev environments.  You also learned how devfiles help you define a consistent experience for developing within a CodeCatalyst project.  Please follow our DevOps blog channel as I continue to explore how CodeCatalyst solve Maxine’s and other builders’ challenges.

About the author:

Ryan Bachman

Ryan Bachman is a Sr. Specialist Solutions Architect at AWS, and specializes in working with customers to improve their DevOps practices. Ryan has over 20 years of professional experience as a technologist, and has held roles in many different domains to include development, networking architecture, and technical product management. He is passionate about automation and helping customers increase software development productivity.

Top Tools every Software Developer should know in 2022

With the increase in popularity of software development in the market, the adoption of its tools has also increased. Now, programmers prefer to use the right software developer tool while creating a solution for the client as it makes their lives easier. Besides, the right set of tools can help in getting the maximum output each day. But this choice might be difficult because of the huge number of software development tools available in the market. So, to make this choice easy for you, here, in this blog, we’ll go through a list of top software development tools in 2022 that can be used to boost the professional performance of the software development team.

What is Software Development?

Software development is a simple process that every software programmer uses to create computer programs. The entire process of developing a system for any business organization is known as Software Development Life Cycle (SDLC). This process includes various phases that offer a perfect method for creating products that meet both user requirements and technical specifications. For this, web developers use different types of development tools and the use of the right tool can help in streamlining the entire software development process.

Why Use Software Development Tools?

Developers use software tools to investigate and complete the business processes, optimize them, and document the software development processes. With the use of such tools, the software developers can create a project whose outcome can be more productive. Using the development tools, a software developer can manage the workflow easily.

15 Best Software Development Tools

Some of the top software programming tools every developer can use are:

UltraEdit

UltraEdit is one of the best tools when it comes to creating software with proper security, flexibility, and performance. It comes with an all-access package that offers the developers access to various tools like an integrated FTP client, a file finder, and a Git integration solution. It is a very powerful text editor that has the capabilities to handle large files with a breeze.

Key Features:

It can handle and load large files with proper performance, file load, and startup.
Supports complete OS integration like shell extensions and command lines.
You can configure, customize, and reskin the entire application with the help of beautiful themes.
Accesses the server and opens files with SFTP browser/ Native FTP.
Helps in finding, comparing, and replacing inside files at blazing speed.
Spots visual differences between codes easily.
The all-access package of UltraEdit comes at $99.95 per year.

Atom

Atom is a top integrated development environment (IDE). And it’s open-source nature makes it run on the majority of the popular operating systems. It is a software development tool that is known for its rich level of customization and vast list of third-party integrations. Atom’s attribute, Autocomplete enables the developers to write the code easily and quickly. Besides this, the browser function of this tool simplifies project file management and this is possible because of its interface that comes with numerous panes to compare, view, edit, and compare files, all at once. Basically, Atom is the best option for developers because it can support every popular framework and programming language.

Key Features:

Atom supports cross-platform editing, this means that it can work for different types of operating systems like OS X, Windows, and Linux.
It uses the Electron framework for offering amazing web technologies.
It is a customizable tool that comes with effective features for a better look and feel.
Some of the important features of Atom like smart autocomplete, built-in package manager, multiple panes, find & replace feature, file system browser, etc.

Quixy

Quixy is used by enterprises for its cloud-based no-code platform approach. This tool helps businesses automate their workflows and create all types of enterprise-grade applications. Besides, it helps in eliminating the manual processes and turning different ideas into apps to make businesses transparent, productive, and innovative. 

Key Features:

Quixy helps in creating an app interface as per the client’s requirement by easily dragging and dropping 40+ form fields.
It seamlessly integrates the third-party app with the help of ready-to-use Webhooks, connectors, and API integrations.
It can model any process and create simple complex workflows.
It helps in deploying applications with a single click and making changes anytime.
Quixy also enables the developers to use it on any browser and device even in offline mode.
Offers live actionable dashboards and reports with the idea of exporting data in various formats.

Linx

Linx helps in creating and automating backend apps with a low-coding approach. This tool has the capability to accelerate the design, automation, and development of custom business processes. It offers services for easily integrating systems, apps, and databases. 

Key Features:

Drag and drop, easy-to-use IDE and Server.
It offers live debugging with the use of step-through logic.
Offers 100 pre-built plugins for rapid development.
It automates processes with the help of directory events and timers.

GitHub

GitHub is one of the most popular software development and collaboration tool for code management and review. It enables its users to create software and apps, host the code, manage the projects, and review the code. 

Key Features:

With the help of GitHub, web app developers can easily document their source code.
Some of the features of GitHub like access control and code security make it a more useful tool for all the team members.
GitHub’s project management tools enable app developers to coordinate tasks easily.
This tool can be hosted on servers & cloud platforms and can run on operating systems like Mac and Windows. 

Embold

Embold is one of the most popular tools when it comes to fixing bugs before deployment. It helps in saving a lot of energy and time in the long run. It is a software analytics platform that helps the developers to analyze the source code and uncovers problems that might impact robustness, stability, security, and maintainability.

Key Features:

Embold offers plugins that can help in picking up code vulnerabilities.
It helps in integrating the system seamlessly with Bitbucket, GitHub, and Git.
Embold comes with unique anti-pattern detection that helps in preventing the compounding of unmaintainable code.
With Emhold, it is possible to get faster and deeper checks for more than 10 languages.

Zoho Creator

Zoho Creator, a low-code software development tool enables rapid development and deployment of web applications and assists to create powerful enterprise software apps. Besides, it doesn’t require endless lines of code for creating an app. It comes with different features like JavaScript, Artificial Intelligence, Cloud functions, and more. There are more than 4 million users of this tool all over the world and they use it to enhance the productivity of their business.

Key Features:

Zoho Creator enables the creation of more apps with less effort.
It offers excellent security measures.
Creates insightful reports.
Helps in connecting the business data to different teams. 

GeneXus

GeneXus is a software development tool that offers an intelligent platform for creating applications that enable the automatic development, and maintenance of systems. The applications created using GeneXus can be easily adapted to changes. Besides, it is used when the developer has to work with the newest programming languages.

Key Features:

GeneXus offers an AI-based automatic software approach.
It comes with the highest flexibility which means that it has the capability to support the largest number in the market.
Multi-experience apps can be created using this tool.
It has the best app security module.
It offers business process management support.
With GeneXus, developers get the highest level of deployment flexibility.

NetBeans

NetBeans is a very popular open-source and free software development tool. It is written in Java. Developers use NetBeans to create mobile, web, and desktop applications. This tool uses languages like C / C++, JavaScript, PHP, Java, and more.

Key Features:

With the help of NetBeans, a cross-platform system, developers can create apps that can be used on all different platforms like Mac, Linux, Solaris, Windows, etc.
Java apps can be easily created and updated using NetBeans 8 IDE, the newer edition for code analyzing.
NetBeans is a tool that offers the best features like writing bug-free code, Smart Code Editing, quick user interface development, and an easy management process.
NetBeans allows for the creation of well-organized code that eventually helps the app development team to understand the code structure easily. 

Eclipse

Eclipse is another popular IDE that is majorly used by Java developers. This tool is used to create apps that are not only written in Java but also in programming languages like PHP, ABAP, C, C++, C#, etc.

Key Features:

Eclipse, an open-source tool, plays an important role in the development of new and innovative solutions.
It is used by developers for creating desktop, web, and cloud IDEs.
Eclipse Software Development Kit (SDK) is open-source which means that developers can use it freely for creating any type of application with the help of any programming language.
Eclipse helps in code completion, refactoring, syntax checking, error debugging, rich client platform, industrial level of development, and more.
Integrating Eclipse with other frameworks like JUnit and TestNG is very easy.

Bootstrap

Bootstrap is another open-source framework that is used by software development companies for creating responsive websites and mobile-first projects. For this tool, the developers can use technologies like HTML, CSS, and JS. It is widely used and is designed to make websites simpler. 

Key Features:

Bootstrap is a tool that offers built-in components that can be used in accumulating responsive websites.  by a smart drag and drop facility.
This open-source toolkit comes with various customization options.
It comes with some amazing features like a responsive grid system, pre-built components, plug-ins, sass variables & mixins, and more.
With Bootstrap, the developers get a guarantee of consistency,
Bootstrap, a front-end web framework is used by developers for quick modeling of the ideas.

Cloud 9

Cloud 9 was introduced in the year 2010 Cloud 9. At that time, it was an open-source, cloud-based IDE that supported different programming languages like Perl, C, Python, PHP, JavaScript, and more. But in the year 2016, AWS (Amazon Web Service) acquired this tool and it turned into a chargeable system. 

Key Features:

Cloud 9 IDE, a web-based platform is used by software development companies for scripting and debugging the app code in the cloud.
It comes with various features like code completion suggestions, file dragging debugging, and more.
With the use of Cloud 9, the developers can work with serverless applications.
Cloud 9 IDE is used by both web and mobile developers.
It enables one to create a replica of the entire software development environment.
Developers who use AWS Cloud 9 can share the environment with team members. 

Dreamweaver

Adobe Dreamweaver, an exclusive software programming editor is used to develop both simple and complex websites. It supports languages like CSS, HTML, XML, and JavaScript.

Key Features:

Dreamweaver is used in different operating systems like Windows, iOS, and Linux.
The latest version of this tool can be sued by the developers for creating responsive websites.
Dreamweaver CS6 offers a preview option that enables one to have a look at the designed website.
Dreamweaver CC, another version of this tool is a combination of a code editor and a design surface. It comes with features like code collapsing, auto-completion of code, real-time syntax checking, code inspection, and syntax highlighting.

Bitbucket

Bitbucket, a web-based version control tool is used by the developers for collaboration between teams. It is utilized as a repository for the source code of projects.

Key Features:

Bitbucket is a powerful tool that comes with features like flexible deployment models, code collaboration on steroids, and unlimited private repositories.
With the use of Bitbucket, developers can organize the repositories into different projects.
Bitbucket supports a few services like issue tracking, code search, Git large file storage, integrations, bitbucket pipelines, smart mirroring, and more.

CodeLobster

CodeLobster is another popular software development tool that is free to use and is a very convenient PHP IDE. Developers use it to create fully-featured web applications. This tool supports technologies like HTML, Smarty, JavaScript, Twig, and CSS.

Key Features:

This PHP Debugger facilitates the developers in debugging the systems easily at the time of coding.
CodeLobster PHP Edition makes the development process easy by supporting CMS like Magneto, Joomla, Drupal, and WordPress.
Some of its best features are PHP Debugger, CSS code inspector, PHP Advanced autocomplete, auto-completing of keywords, and  DOM elements.
This tool offers file explorer features and browser previews.

Conclusion

As seen in this blog, there are many different types of software development tools available in the market. And all of them are robust, fully-featured, and widely used. Here, we have listed some of the most popularly used development tools that are used by developers for creating unique solutions for their clients. The choice between these tools might be difficult at first, but if the developer properly studies the project and its requirements, choosing the right software developer tool can be really easy. And it can help in creating the finest project.

The post Top Tools every Software Developer should know in 2022 appeared first on Flatlogic Blog.Flatlogic Admin Templates banner

Bringing a little slice of Developer Tools to Seq in 2022.1

If your experience is anything like mine, debugging in production is as much about organizing information – clues, leads, sometimes frustrating dead-ends – as it is about unearthing it. Working through an issue, I need pen and paper, sticky notes, whiteboards and spreadsheets as much as I depend on searching logs.

Seq is never going to replace my favorite Lamy pen (a chrome Pico I’ve hung onto for absolutely years ?), but in 2022.1 there are two small improvements coming that should help with the information overload:

Variables as an alternative to copy-and-paste for keeping track of useful values, and
A redesigned (and searchable!) history makes it easier to jump back to an earlier search or query.

Search history doesn’t need much explanation (it’s now a tool window you can pop out in the signal bar), but variables are actually pretty interesting.

When GUIDs start to look alike…

The basic scenario looks like this:

Why does request cbc6f181ba66498092c78bdd4106e3f1 time out, while request c43df41457dd443a83f1bcf94353a3c7 succeeds?

Instead of copying those values back and forth to a text editor window, inevitably forgetting which is on the clipboard at any given moment, Seq 2022.1 supports assigning them to variable names:

select ‘cbc6f181ba66498092c78bdd4106e3f1’ into $failingRequest

You can use the resulting variable names in any expression where you would otherwise use the value:

The design of variables in Seq takes inspiration from the ubiquitous browser developer tools console: variables are somewhere to stash and inspect useful pieces of information while you work on a problem.

This could be a little confusing if you were expecting variables to behave more like those in procedural languages such as Transact-SQL or PL/pgSQL. Seq doesn’t support procedural programming, so there’s no way to, say, reassign a variable on each iteration of a loop. If you’re here looking for something along those lines, check out let bindings instead.

Quick variables

The green check-mark menu beside event properties can now be used to assign the value of a property to a new variable:

Seq will generate a variable name based on the property name. Variables can’t be directly renamed, but you can give a variable a more meaningful name by selecting its value into a new one:

select $requestId0 into $slowRequest

Variables in signals, alerts, and dashboards

Variables are tracked client-side, and passed back to the server by the Seq UI whenever they appear in a search or query. The value you assign to a variable doesn’t live any longer than your browser session.

This means that variable values aren’t available when signals are indexed, when alerts are checked, or when your dashboard is rendered on an overhead display. To avoid silently failing with incorrect results, Seq will reject all variable references that appear in these places:

Wrapping up the tour

So that’s it! Variables are a simple feature, but also part of an exciting direction that we’re going to explore further.

You can find out more about variables – the scenarios we’ve thought about, and some of the implementation details – in the Variables RFC.

Or, to jump in and try them against your next production debugging puzzle, pull the datalust/seq:preview Docker image, or download the 2022.1.*-pre MSI from the Seq downloads page. We can’t wait to hear how you go!

Flatlogic Admin Templates banner

Adding feature flags to an ASP.NET Core app

This post is about Adding feature flags to an ASP.NET Core app.Feature flags (also known as feature toggles or feature switches) are a software development technique that turns certain functionality on and off during runtime, without deploying new code. In this post we will discuss about flags using appsettings.json file. I am using an ASP.NET Core MVC project, you can do it for any .NET Core project like Razor Web Apps, or Web APIs.

First we need to add reference of Microsoft.FeatureManagement.AspNetCore nuget package – This package created by Microsoft, it will support creation of simple on/off feature flags as well as complex conditional flags. Once this package added, we need to add the following code to inject the Feature Manager instance to the http pipeline.

using Microsoft.FeatureManagement;

var builder = WebApplication.CreateBuilder(args);
builder.Services.AddControllersWithViews();

builder.Services.AddFeatureManagement();

var app = builder.Build();

Next we need to create a FeatureManagement section in the appsettings.json with feature with a boolean value like this.

“FeatureManagement”: {
“WelcomeMessage”: false
}

Now we are ready with feature toggle, let us write code to manage it from the controller. In the controller, ASP.NET Core runtime will inject an instance of the IFeatureManager. And in this interface we can check whether a feature is enabled or not using the IsEnabledAsync method. So for our feature we can do it like this.

public async Task<IActionResult> IndexAsync()
{
if(await _featureManager.IsEnabledAsync(“WelcomeMessage”))
{
ViewData[“WelcomeMessage”] = “Welcome to the Feature Demo app.”;
}
return View();
}

And in the View we can write the following code.

@if (ViewData[“WelcomeMessage”] != null)
{
<div class=“alert alert-primary” role=“alert”>
@ViewData[“WelcomeMessage”]
</div>
}

Run the application, the alert will not be displayed. You can change the WelcomeMessage to true and refresh the page – it will display the bootstrap alert.

This way you can start introducing Feature Flags or Feature Toggles in ASP.NET Core MVC app. As you may already noticed the Feature Management library built on top of the configuration system of .NET Core. So it will support any configuration sources as Feature flags source. Microsoft Azure provides Azure App Configuration service which helps to implement feature flags for cloud native apps.

Happy Programming 🙂Flatlogic Admin Templates banner