Skip to content

Releases: hassanhabib/The-Standard

v2.11.1

23 Nov 13:52
Compare
Choose a tag to compare

This release promotes the Last Day principle. Which says:
"Everyday can be the last day on any given project. Therefore, every effort, whether it be a design, development, documentation or testing automation must be brought to a good stopping point at the end of every engineering day. Engineers adhering to The Standard must ensure that their work is in a state that can be picked up by another engineer on the very next engineering day. This practice ensures the continuity of the project, but more importantly the accomodation of any potential unforeseen circumstances."

v2.11.0

28 Oct 04:19
Compare
Choose a tag to compare

What's Changed

  • DOCUMENTATION: Update v2.10.3 FromTask by @glhays in #293
  • DOCUMENTATION: Adds async SelectAll Broker Sample by @glhays in #298
  • DOCUMENTATION: Support Brokers Abstraction v2.10.3 by @glhays in #300
  • DOCUMENTATION: v2.10.3 Abstraction Refinement by @glhays in #302
  • DOCUMENTATIONS: Add The Standard in Russian by @ZafarUrakov in #306
  • CODE RUB: Reverts Validation Private Method Asynchronous Abstraction by @glhays in #311
  • STANDARD: Controllers v2.11.0 by @glhays in #308
  • Revert "STANDARD: Controllers v2.11.0" by @hassanhabib in #312

New Contributors

Full Changelog: v2.10.3...v2.11.0

v2.10.3

01 Aug 16:58
c4f6718
Compare
Choose a tag to compare

V2.10.3

What's New

This release contains the asynchronization abstraction at the operation level, and a new principle regarding readability over optimization

In this release you will learn about:

  • Find more information regarding Asynchronization Abstraction: Here
  • Find more information regarding Readability over Optimization: Here

Contributions

New Contributors

Release Closes: #289

Full Changelog: v2.10.2...v2.10.3

v2.10.2

09 Jun 18:36
911b3c9
Compare
Choose a tag to compare

What's New

This release contains the rules for Exposure Layers APIs naming conventions and http verbs.
In this release you will learn about:

  • Using custom http verbs/methods to support your API capabilities here
  • Routes naming conventions for all cases, such as many-to-one, many-to-many and one-to-one here
  • Introduction to x-form-urlencoded parameters here

Contributions

New Contributors

Full Changelog: v2.10.1...v2.10.2

V2.10.1

27 Apr 23:18
99a1b5e
Compare
Choose a tag to compare

What's Changed

*The major feat of this release is in the Exception models adhering to Anemic Data Models, and the exception messaging will now exist in the Service layer.

The Standard Community would like to give a special thanks to Abdulsamad Osunlana (@aosunlana) for his major contribution to this release. As well as all the community members for contributing time to the success of The-Standard

With the new version v2.10.1, we adhere to a full anemic exception model and move the string messaging to the Services layer as will be shown later. This new upgrade to the Standard will still enforce a strong binding to the exception messages and the testing messages. This will also put all string messages in the appropriate service layer logic.

V2.10.0 Exception Model Sample:

public class FailedFileServiceException : Xeption
    {
        public FailedFileServiceException(Exception innerException)
            : base(message: "Failed file service error occurred, contact support.",
                innerException: innerException)
        { }

        public FailedFileServiceException(string message, Exception innerException)
            : base(message, innerException)
        { }
}

V2.10.1 Exception (anemic) Model:

public class FailedFileServiceException : Xeption
    {
        public FailedFileServiceException(string message, Exception innerException)
            : base(message, innerException)
        { }
}

V2.10.0...2.10.1 Test logic remains the same

[Fact]
        private void ShoudThrowServiceExceptionOnWriteIfServiceErrorOccurs()
        {
            // given
            string somePath = GetRandomString();
            string someContent = GetRandomString();
            var serviceException = new Exception();

            var failedFileServiceException =
                new FailedFileServiceException(
                    message: "Failed file service error occurred, contact support.",
                    innerException: serviceException);

            var fileServiceException =
                new FileServiceException(
                    message: "File service error occurred, contact support.",
                    innerException: failedFileServiceException);

            this.filesBrokerMock.Setup(broker =>
                broker.WriteToFile(It.IsAny<string>(), It.IsAny<string>()))
                    .Throws(serviceException);

            // when
            Action writeToFileAction = () =>
                this.fileService.WriteToFile(somePath, someContent);

            // then
            FileServiceException actualFileServiceException =
                Assert.Throws<FileServiceException>(writeToFileAction);

            actualFileServiceException.Should().BeEquivalentTo(
                fileServiceException);

            this.filesBrokerMock.Verify(broker =>
                broker.WriteToFile(It.IsAny<string>(), It.IsAny<string>()),
                    Times.Once);

            this.filesBrokerMock.VerifyNoOtherCalls();
        }

V2.10.1 Services layer message handling examples:

Messages will now be within the service layer exception sub class like so.

Services/Foundations/Files/FileService.Exceptions.cs
 public partial class FileService
    {
        private delegate void ReturningNothingFunction();
        private static void TryCatch(ReturningNothingFunction returningNothingFunction)
        {
            try
            {
                returningNothingFunction();
            }
            catch (InvalidFilePathException invalidFilePathException)
            {
                throw CreateFileValidationException(invalidFilePathException);
            }
            catch (InvalidFileContentException invalidFileContentException)
            {
                throw CreateFileValidationException(invalidFileContentException);
            }
            catch (ArgumentNullException argumentNullException)
            {
                var invalidFileException =
                    new InvalidFileException(
                        message: "Invalid file error occurred.",
                        innerException: argumentNullException);

                throw CreateFileDependencyValidationException(invalidFileException);
            }
            catch (ArgumentException argumentException)
            {
                var invalidFileException =
                    new InvalidFileException(
                        message: "Invalid file error occurred.",
                        innerException: argumentException);

                throw CreateFileDependencyValidationException(invalidFileException);
            }
            catch (SerializationException serializationException)
            {
                var failedFileSerializationException =
                    new FailedFileSerializationException(
                        message: "Failed file serialization error occurred, contact support.",
                        innerException: serializationException);

                throw CreateFileDependencyException(failedFileSerializationException);
            }
            catch (Exception exception)
            {
                var failedFileServiceException =
                    new FailedFileServiceException(
                        message: "Failed file service error occurred, contact support.",
                        innerException: exception);

                throw CreateFileServiceException(failedFileServiceException);
            }
        }
        
         private static FileValidationException CreateFileValidationException(
            Xeption innerException)
        {
            return new FileValidationException(
                message: "File validation error occurred, fix the errors and try again.",
                innerException: innerException);
        }

        private static FileDependencyValidationException CreateFileDependencyValidationException(
            Exception innerException)
        {
            return new FileDependencyValidationException(
                message: "File dependency validation error occurred, fix the errors and try again.",
                innerException: innerException);
        }

        private static FileDependencyException CreateFileDependencyException(
            Xeption innerException)
        {
            return new FileDependencyException(
                message: "File dependency error occurred, contact support.",
                innerException);
        }

        private static FileServiceException CreateFileServiceException(
            Xeption innerException)
        {
            return new FileServiceException(
                message: "File service error occurred, contact support.",
                innerException: innerException);
        }

Closes: #272

Commit changes new in this Release

New Contributors

Full Changelog: v2.10.0...v2.10.1

v2.10.0

07 Aug 03:17
8dda80b
Compare
Choose a tag to compare

What's Changed

  • We used to test for exception handling without verifying the exception message.

This is how we used to handle exceptions:

        [Fact]
        public async Task ShouldThrowDependencyValidationExceptionOnRetrieveIfValidationExceptionOccursAsync()
        {
            // given
            string someNaturalQuery = GetRandomString();
            var innerValidationException = new Xeption();

            var completionClientValidationException =
                new CompletionClientValidationException(
                    innerValidationException);

            var invalidAIException =
                new InvalidAIQueryException(
                    innerValidationException);

            var expectedAIDependencyValidationException =
                new AIDependencyValidationException(
                    invalidAIException);

            this.aiBrokerMock.Setup(broker =>
                broker.PromptCompletionAsync(It.IsAny<Completion>()))
                    .ThrowsAsync(completionClientValidationException);

            // when
            ValueTask<string> retrieveSqlQueryTask =
                this.aiService.PromptQueryAsync(someNaturalQuery);

            AIDependencyValidationException actualAIDependencyValidationException =
                await Assert.ThrowsAsync<AIDependencyValidationException>(
                    retrieveSqlQueryTask.AsTask);

            // then
            actualAIDependencyValidationException.Should().BeEquivalentTo(
                expectedAIDependencyValidationException);

            this.aiBrokerMock.Verify(broker =>
                broker.PromptCompletionAsync(It.IsAny<Completion>()),
                    Times.Once);

            this.aiBrokerMock.VerifyNoOtherCalls();
        }

The issue here is that if the exception model message changed - no tests will fail. This is a vulnerability in our tests since it can't detect changes in messages that are going to be broadcasted to end-users/consumers.

This release brings the following upgrade:

Starting with the exception models themselves, we will add a new constructor overload as follows:

internal class InvalidAIQueryException : Xeption
    {
        ...
        ...
       
        public InvalidAIQueryException(string message, Exception innerException)
            : base (message, innerException) {}
    }

This new overload will enable our tests to verify exact messages as follows:

        [Fact]
        public async Task ShouldThrowDependencyValidationExceptionOnRetrieveIfValidationExceptionOccursAsync()
        {
            // given
            string someNaturalQuery = GetRandomString();
            var innerValidationException = new Xeption();

            var completionClientValidationException =
                new CompletionClientValidationException(
                    innerValidationException);

            var invalidAIException =
                new InvalidAIQueryException(
                    message: "Invalid AI Query error occurred, fix the errors and try again.",
                    innerException: innerValidationException);

            var expectedAIDependencyValidationException =
                new AIDependencyValidationException(
                    message: "AI validation error occurred, fix the errors and try again.",
                    innerException: invalidAIException);

            this.aiBrokerMock.Setup(broker =>
                broker.PromptCompletionAsync(It.IsAny<Completion>()))
                    .ThrowsAsync(completionClientValidationException);

            // when
            ValueTask<string> retrieveSqlQueryTask =
                this.aiService.PromptQueryAsync(someNaturalQuery);

            AIDependencyValidationException actualAIDependencyValidationException =
                await Assert.ThrowsAsync<AIDependencyValidationException>(
                    retrieveSqlQueryTask.AsTask);

            // then
            actualAIDependencyValidationException.Should().BeEquivalentTo(
                expectedAIDependencyValidationException);

            this.aiBrokerMock.Verify(broker =>
                broker.PromptCompletionAsync(It.IsAny<Completion>()),
                    Times.Once);

            this.aiBrokerMock.VerifyNoOtherCalls();
        }

Full Changelog: v2.9.0...v2.10.0

v2.9.0

17 Jul 22:22
5b4da25
Compare
Choose a tag to compare

This release is a non breaking change release to The-Standard v1444.09.08.

The goal of this release is to establish a baseline for project to standard versioning going forward of this release date.
All current running projects will be set to this version, and all past projects will be set based on a dating scenario.
It is not a perfect scenario but it has been said "A line has to be drawn somewhere".

What's Changed

New Contributors

Full Changelog: 1444.09.08...v2.9.0

1444.09.08

30 Mar 03:25
b3fdf1a
Compare
Choose a tag to compare

What's Changed

  • DOCUMENTATION: Changed the Rest verb of example by @Gustavo-Marques19 in #231
  • DOCUMENTATION: Added links to external resources by @cjdutoit in #232
  • CODERUB: Corrected namespace. by @artisansol in #237
  • CODERUB: Sentence correction by @artisansol in #240
  • CODERUB: Typo fix by @artisansol in #239
  • CODE RUB: Resolved namespace for IStorageBroker.Students.cs by @artisansol in #238
  • CODE RUB: Typo fix by @artisansol in #241
  • CODE RUB: Typo fix by @artisansol in #242
  • CODE RUB: Corrected sample test code and typo fix by @artisansol in #243
  • CODE RUB: Typo Fix, Library Name correction by @artisansol in #244
  • CODE RUB: Typo fix, Method name correction by @artisansol in #247
  • Updated Other Resources by @Boorda in #250

New Contributors

Full Changelog: 1444.06.14...1444.09.08

1444.06.14

07 Jan 19:16
Compare
Choose a tag to compare

This release contains Standardized Provider Abstraction Libraires chapter amongst many other smaller modifications and corrections.

Special thanks to @ElbekDeveloper, @cjdutoit and @ShriHumrudha for their contributions to this release.

What's Changed

  • CODE RUB: Hanging sentence: intermediary model by @sd-tang in #206
  • CODE RUB: Should be studentLibraryCardProcessingService by @sd-tang in #209
  • DOCUMENTATION: Fix Foundation Services index links and subchapters by @LBoullosa in #208
  • DOCUMENTATION: Adding Examples in Other Languages by @hassanhabib in #210
  • CODE RUB: Grammar Fix on Up & Sideways by @sd-tang in #212
  • DOCUMNETATION: Add Reasoning for Randomization in Testing by @hassanhabib in #213
  • CODE RUB: Update 2.1 Foundations.md by @ccampora in #214
  • DOCUMENTATION: Removed duplicate 404 entry by @ShriHumrudha in #215

New Contributors

Full Changelog: 2.0.3...1444.06.14

2.0.3

28 Sep 14:27
5afd28e
Compare
Choose a tag to compare

This release includes a new upgrade to StorageBrokers as referenced in the Brokers section.

Thanks to @danielle-io for the insights.

What's Changed

New Contributors

Full Changelog: 2.0.2...2.0.3