COSC2759-CI/CD pipeline coding Assignment
- Subject Code :
COSC2759
Scenario
Alpine Inc has recently built a web application that allows users to record simple Notesapplication. The application is built using NodeJs, Express and backed by a NoSQLMongoDB.
ThesourcecodeforthisapplicationisstoredinGitHubbutthecodeitselfisbuiltanddeployedmanuallyfromtheleaddevelopers(Pete)laptop.Althoughthisprocesshasworked in the past, Pete had recently taken leave from work which has meant thatAlpine Inc missed a critical release that contained a new feature for one of their largestclients.
There have also been instances where bugs have been introduced into productionwhich has caused an increase in the number of support calls from their customers, andthe support and development teams have had to work overtime to manage the loadand ?x the issues. These issues are causing reduced morale among the teams, as wellasimpactingtherevenueofAlpineInc.
As the newly hired DevOps practitioner, Alpine Inc has turned to you to help resolvetheir issues and enable their teams to better deliver new features and ensure releasesintoproductionarequickandreliable.
To help kick off this transformation, you have proposed that Alpine Inc start looking atestablishingaCIpipelinetohelpreducedependencyonPetebyintroducingautomatedbuildsandautomatetheirtestingprocesses.Thiswillreducethestrainonthe QA team and ensure bugs and development defects are picked up quickly and fedbacktodeveloperstoberesolvedbeforeanychangesarepromotedtoproduction.
TheApproach
TomakethiseasierforAlpineInc,whichisratherimmaturewithDevOpsmethodologies and practices, you have opted to use SaaS tools where possible to helpreduce the learning curve for their development team. You will follow best practiceprinciples and make as much of your solution using code, this includes your CI buildcon?gurationandscaffoldingscripts.
Toolstouse:
- GitHub (GitHub Classroom)
- GitHubActionsusedforcreatingthepipelines
- Docker
- DockerCompose
- Basicnpmcommands
After a lengthy and heated debate amongst the team, it was decided to use GitHubFlowasthebranchingstrategy.Ratherthancommittingdirectlytothemainbranch,itwasagreedtoalwaysusefeaturebranchesandpullrequests.HoweveritwasalsoagreedthatengineerscouldapprovetheirownPRs.
Deliverable
AlpineIncexpectsyouupdateyourGitHubclassroomrepositorywiththecodeanddocumentationrequiredtoruntheContinuousIntegrationbuildyouarecreatingforthemincludingall?les.
Youtaskisto:
- De?neaCIpipelinebycreatinga?leinthe.github/work?owsYourpipelinewillautomaticallyexecuteonGitHubActionrunners.
- De?neyourmd.
Notethatwhenyouimplementthingslikelintingandend-to-endtesting,youmightdiscoverbugsorerrorswhichthedevelopmentteamhadnotnoticedbefore!Youwillneedto?xthemsothatyourpipelinepasses.(Hint:someofthepackageversionspinnedbythedevteaminpackage.jsonmightneedtobebumpedtooperateinamorecurrentenvironment.)
AccessGitHubClassroom
WewillbeusingGithubclassroomtoeditandmanagethecodebase.Allthecore?lesfortheapplicationwillbeprovidedtoyouhere.PleaseaccepttheinvitebelowtojointheclassroomandgetaccesstoAssignment#1.Youwillbeexpectedtoworkandmakeyourcommitstothisrepo.
- Jointheclassroomhttps://classroom.github.com/a/ghul3XDeandloginwithyourGithub
- Chooseyourstudentnumberfromthelistyouare
- ClickontheAccepttheassignmentbutton
- Afteryouaccepttheinvitation,waituntiltheprocessis
- Clickonthelinktogotoyournewlycreatedrepository
- YouwillbetakentoyournewThecore?lesforthisassignmenthavebeen provided to you. Click the code button and clone this repo to your localmachinetostartworking.
MarkingGuide
TheAlpineIncteamneedstobeabletounderstandwhyyouchosetoapproachyoursolutionthewayyoudid.Createadocumentwithdetailsforeachoftheelementsinyoursolution,explainhowtheelementworksandhowitformspartoftheoverallDevOpsprocess.Writeaslittleaspossibletocommunicateyourmessage.Addscreenshotswhereappropriatetodemonstratethatyouhavecompletedtherequirementsofeachsection.
ForaPass
- Createamdattherootofyourgitrepothatcontainsthefollowingsections:
- Analysisoftheproblem(Whatareyoutryingtosolve?)(5%)
- Explainandjustifythesolution(Howdoesthesolutionwork?)(10%)
- Writingquality,layout,andaccuracy (5%)
- ThingsthatneedtobeaddedtoyourContinuousIntegrationbuild
- Static CodeAnalysis/Lint (4%)
- Unittesting(4%)
- Ensurecodecoverageischecked(Hint:ResearchhowyouenablecodecoveragewithJest)
(4%)
- Implementafailurescenario (4%)
- Generatinganartefactthatcanbedeployed(4%)
- Ensureproperbranchingisimplemented(GitHubFlowisrequired)
- Ensurenewfeaturesaredevelopedonfeaturebranchesandmergedintomainwith Pull Requests. Pull requests can be reviewed and approved by(10%)
ForCredit
- Performalltasksfromthepreviouslevelandinaddition:
- HaveyourCIbuildstriggerwhenachangeoccurstoanybranch (4%)
- Ensurethepipelineworkswithmultiplebranches (12%)
- EnsureartefactsaregeneratedonthemainbranchONLY (4%)
ForDistinction
- Performalltasksfromthepreviouslevelandinaddition:
- RunintegrationtestingaspartoftheHavetheCIPipelineensureautomatedtestsvalidatethattheapplicationintegratesproperlywiththeMongoDBBackend.YoushouldbeleveragingdockertostandupacontainerisedversionoftheDBandruntestsagainstit.IntegrationtestsarewritteninJestanddetailsonhowtoruntheseareincludedintheprojectReadMe. (5%)
- Ifthetestsfail,breakthebuildandreportbackwhyitfailedinthe(5%)
ForHigh-Distinction
- Performalltasksfromthepreviouslevelandinaddition:
- Runend-to-endtestsaspartoftheEnd-to-endtestingisatestthatchecksifthe?owofanapplicationfromstartto?nishisbehavingasexpected.Thepurposeofperformingend-to-endtestingisto?ndsystemdependenciesandtoensurethatthedataintegrityismaintainedbetweenvarioussystemcomponentsandsystems.PleasereadtheReadMe?leontheproject.
(10%)
- Executeautomatedteststhatvalidatethattheapplicationfunctionsasexpectedfromtheuser
(5%)
- Ifthetestsfail,breakthebuildandreportbackwhyitfailedinthe(5%)
Plagiarism
Allassignmentswillbecheckedwithplagiarism-detectionsoftware;anystudentfoundtohaveplagiarizedwouldbesubjecttodisciplinaryaction.
Plagiarismincludes:
- CONTRACTCHEATING:payingsomeonetodoyourwork
- CONTRACTCHEATING:gettingsomeoneelsetowritethetestorattenddemo
- submittingworkthatisnotyourownorsubmittingtextthatisnotyourown
- copyingworkfrom/ofprevious/currentsemesterstudents
- allowingotherstocopyyourworkviaemail,printouts,socialmedia
- postingassignmentquestions(infullorpartial)onexternaltechnicalforums
- sendingorpassingyourworktoyourfriends
- postingassignmentquestionsontechnicalforumstogetthem
Adisciplinaryactioncanleadto:
- ameetingwiththedisciplinarycommittee
- a score of zero for the assignment
- apermanentrecordofcopyinginyourpersonaluniversityrecordsand/or
- expulsionfromtheuniversity,insomeseverecases
All plagiarism will be penalised. There are no exceptions and no excuses. You havebeenwarned.FormoredetailspleasereadRMITspageonAcademicIntegrityathttps://www.rmit.edu.au/students/student-essentials/assessment-and-exams/academic-integrity
GenerativeAItoolssuchasChatGPTshouldbeapproachedwithcaution.TheAIisbasically re-packaging text that somebody else has written. (We will discuss the issueinclass,bothintermsofacademicstandardsandbecausethetechnologywillbeimportantinyourcareers.)Keepitsimpleandonlysubmitworkwhichyoudidyourself.Please askif you haveany questions orare not sureabout anything.
SubmissionProcedure
Submit your assignmentby usingWebsite URLsubmission option:
- Website URL, is the URL of your GitHub repository formatted likehttps://github.com/rmit-computing-technologies/cosc2759-assignment-1-
githubusername> - Commentshouldbe:YourfullnameandStudentID
Latesubmissionsandextension-relatedinformation
Apenaltyof10%perdayofthetotalmarksforeachassignmentwillapplyforeachdayasubmissionislate,includingbothweekdaysandtheweekend.After5days,youwillreceivezeromarksforthatassignment.
ContactthecoursecoordinatorShekharKalra(shekhar.kalra@rmit.edu.au)forextensionrelatedqueries.